Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker Compose for MacOS / Linux / Windows #52

Closed
matanbaruch opened this issue Jan 23, 2024 · 2 comments
Closed

Docker Compose for MacOS / Linux / Windows #52

matanbaruch opened this issue Jan 23, 2024 · 2 comments

Comments

@matanbaruch
Copy link

matanbaruch commented Jan 23, 2024

Hey,
For anyone having problems with running preview version of Redash (redash/redash:preview)

Use this docker-compose.yml (Alerts is also working)

version: "3"
services:
  server:
    image: redash/redash:preview
    depends_on:
      init-server:
        condition: service_completed_successfully
    restart: always
    environment:
      PYTHONUNBUFFERED: "0"
      REDASH_LOG_LEVEL: "INFO"
      REDASH_REDIS_URL: "redis://redis:6379/0"
      REDASH_COOKIE_SECRET: "xuiCIAEfejj05ZUzQ0odb5pwBttXUkE4"
      REDASH_SECRET_KEY: "9emtXqroCnNhFiETBiFXoQvA4PH0nQuP"
      REDASH_DATABASE_URL: "postgresql://postgres:YKK1KkvPb4ula2HRXlnd7z7n6rVbWKSq@postgres/postgres"
      REDASH_RATELIMIT_ENABLED: "false"
      REDASH_MAIL_DEFAULT_SENDER: "redash@example.com"
      REDASH_MAIL_SERVER: "email"
      REDASH_MAIL_PORT: 1025
      REDASH_ENFORCE_CSRF: "true"
      REDASH_GUNICORN_TIMEOUT: 60
    ports:
      - "5000:5000"
    platform: linux/amd64
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:5000/ping"]
      interval: 1s
      timeout: 2s
      retries: 30


  init-server:
    image: redash/redash:preview
    depends_on:
      - postgres
      - redis
    command:
      - create_db
    environment:
      PYTHONUNBUFFERED: "0"
      REDASH_LOG_LEVEL: "INFO"
      REDASH_REDIS_URL: "redis://redis:6379/0"
      REDASH_COOKIE_SECRET: "xuiCIAEfejj05ZUzQ0odb5pwBttXUkE4"
      REDASH_SECRET_KEY: "9emtXqroCnNhFiETBiFXoQvA4PH0nQuP"
      REDASH_DATABASE_URL: "postgresql://postgres:YKK1KkvPb4ula2HRXlnd7z7n6rVbWKSq@postgres/postgres"
      REDASH_RATELIMIT_ENABLED: "false"
      REDASH_MAIL_DEFAULT_SENDER: "redash@example.com"
      REDASH_MAIL_SERVER: "email"
      REDASH_MAIL_PORT: 1025
      REDASH_ENFORCE_CSRF: "true"
      REDASH_GUNICORN_TIMEOUT: 60
    ports:
      - "5000:5000"
    platform: linux/amd64

  scheduler:
    image: redash/redash:preview
    depends_on:
      - redis
    restart: always
    command: scheduler
    environment:
      QUEUES: "celery"
      WORKERS_COUNT: 1
      PYTHONUNBUFFERED: "0"
      REDASH_LOG_LEVEL: "INFO"
      REDASH_REDIS_URL: "redis://redis:6379/0"
      REDASH_COOKIE_SECRET: "xuiCIAEfejj05ZUzQ0odb5pwBttXUkE4"
      REDASH_SECRET_KEY: "9emtXqroCnNhFiETBiFXoQvA4PH0nQuP"
      REDASH_DATABASE_URL: "postgresql://postgres:YKK1KkvPb4ula2HRXlnd7z7n6rVbWKSq@postgres/postgres"
      REDASH_RATELIMIT_ENABLED: "false"
      REDASH_MAIL_DEFAULT_SENDER: "redash@example.com"
      REDASH_MAIL_SERVER: "email"
      REDASH_MAIL_PORT: 1025
      REDASH_ENFORCE_CSRF: "true"
      REDASH_GUNICORN_TIMEOUT: 60
    platform: linux/amd64

  worker:
    image: redash/redash:preview
    depends_on:
      - redis
    restart: always
    command: worker
    environment:
      QUEUES: "scheduled_queries,schemas,periodic,emails,default"
      WORKERS_COUNT: 6
      PYTHONUNBUFFERED: "0"
      REDASH_LOG_LEVEL: "INFO"
      REDASH_REDIS_URL: "redis://redis:6379/0"
      REDASH_COOKIE_SECRET: "xuiCIAEfejj05ZUzQ0odb5pwBttXUkE4"
      REDASH_SECRET_KEY: "9emtXqroCnNhFiETBiFXoQvA4PH0nQuP"
      REDASH_DATABASE_URL: "postgresql://postgres:YKK1KkvPb4ula2HRXlnd7z7n6rVbWKSq@postgres/postgres"
      REDASH_RATELIMIT_ENABLED: "false"
      REDASH_MAIL_DEFAULT_SENDER: "redash@example.com"
      REDASH_MAIL_SERVER: "email"
      REDASH_MAIL_PORT: 1025
      REDASH_ENFORCE_CSRF: "true"
      REDASH_GUNICORN_TIMEOUT: 60
    platform: linux/amd64

  adhoc-worker:
    image: redash/redash:preview
    depends_on:
      - redis
    restart: always
    command: worker
    environment:
      QUEUES: "queries"
      WORKERS_COUNT: 2
      PYTHONUNBUFFERED: "0"
      REDASH_LOG_LEVEL: "INFO"
      REDASH_REDIS_URL: "redis://redis:6379/0"
      REDASH_COOKIE_SECRET: "xuiCIAEfejj05ZUzQ0odb5pwBttXUkE4"
      REDASH_SECRET_KEY: "9emtXqroCnNhFiETBiFXoQvA4PH0nQuP"
      REDASH_DATABASE_URL: "postgresql://postgres:YKK1KkvPb4ula2HRXlnd7z7n6rVbWKSq@postgres/postgres"
      REDASH_RATELIMIT_ENABLED: "false"
      REDASH_MAIL_DEFAULT_SENDER: "redash@example.com"
      REDASH_MAIL_SERVER: "email"
      REDASH_MAIL_PORT: 1025
      REDASH_ENFORCE_CSRF: "true"
      REDASH_GUNICORN_TIMEOUT: 60
    platform: linux/amd64

  redis:
    image: redis:7.0-alpine
    restart: always

  postgres:
    image: postgres:15-alpine
    restart: always
    environment:
      POSTGRES_PASSWORD: "YKK1KkvPb4ula2HRXlnd7z7n6rVbWKSq"

  nginx:
    image: redash/nginx:latest
    ports:
      - "80:80"
    depends_on:
      - server
    links:
      - server:redash
    restart: always

  email:
    image: maildev/maildev
    ports:
    - "1080:1080"
    - "1025:1025"
    restart: always
@justinclift
Copy link
Member

Looking over that compose file, it has an awful lot of duplication of environment variables.

In theory (!), you should be able to throw the duplicates into a separate file and have them all refer to it.

That's what the env file is meant for here:

env_file: /opt/redash/env


That aside, the title for this issue mentions MacOS / Linux / Windows in it, but the compose file has platform: linux/amd64. What's the concept there? 😄

@matanbaruch
Copy link
Author

You are right :)
I will open another issue with correct compose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants