Docker-compose.yml

Hi

I want to make redash on Docker.

Please tell me the contents of docker-compose.yml.

※This is the yml file that was included from the beginning
/# This configuration file is for the *development setup.
/# For a production example please refer to setup/docker-compose.yml.
version: ‘3.2’
services:
server:
build: .
command: dev_server
depends_on:
- postgres
- redis
ports:
- “5000:5000”
- “5678:5678”
volumes:
- “.:/app”
environment:
PYTHONUNBUFFERED: 0
REDASH_LOG_LEVEL: “INFO”
REDASH_REDIS_URL: “redis://redis:6379/0”
REDASH_DATABASE_URL: “postgresql://postgres@postgres/postgres”
REDASH_RATELIMIT_ENABLED: “false”
scheduler:
build: .
command: dev_scheduler
volumes:
- type: bind
source: .
target: /app
depends_on:
- server
environment:
REDASH_REDIS_URL: “redis://redis:6379/0”
REDASH_MAIL_DEFAULT_SENDER: redash@example.com
REDASH_MAIL_SERVER: email
worker:
build: .
command: dev_worker
volumes:
- type: bind
source: .
target: /app
depends_on:
- server
tty: true
environment:
PYTHONUNBUFFERED: 0
REDASH_LOG_LEVEL: “INFO”
REDASH_REDIS_URL: “redis://redis:6379/0”
REDASH_DATABASE_URL: “postgresql://postgres@postgres/postgres”
celery-worker:
build: .
command: dev_celery_worker
volumes:
- type: bind
source: .
target: /app
depends_on:
- server
- email
environment:
PYTHONUNBUFFERED: 0
REDASH_LOG_LEVEL: “INFO”
REDASH_REDIS_URL: “redis://redis:6379/0”
REDASH_DATABASE_URL: “postgresql://postgres@postgres/postgres”
QUEUES: “queries,scheduled_queries”
WORKERS_COUNT: 2
REDASH_MAIL_DEFAULT_SENDER: redash@example.com
REDASH_MAIL_SERVER: email
redis:
image: redis:3-alpine
restart: unless-stopped
postgres:
image: postgres:9.5-alpine
# The following turns the DB into less durable, but gains significant performance improvements for the tests run (x3
# improvement on my personal machine). We should consider moving this into a dedicated Docker Compose configuration for
# tests.
ports:
- “15432:5432”
command: “postgres -c fsync=off -c full_page_writes=off -c synchronous_commit=OFF”
restart: unless-stopped
email:
image: djfarrelly/maildev
ports:
- “1080:80”
restart: unless-stopped

I want to use redash V8.

And What commands are required to display the redash management console?

The docker-compose.yml file you need is available in the Redash repo. There’s no need to write your own.

@jesse

Thank you reply.

You mean this content is 「no need to write your own」?

If you build without changing this content, v9.0.0 will be installed.
How can I install the stable version of v8.0.0?

1 Like

The best way is to follow setup instructions: https://redash.io/help/open-source/setup#-Other

Also, if you directly clone repo from github - checkout the tag you need (v8.0.0) instead of master branch.

@levko

Thank you

I try install this procedure.

https://redash.io/help/open-source/dev-guide/docker

I’m sorry,Where is this( checkout the tag you need ( v8.0.0 ) instead of master branch.)

It’s in a case you try to build Redash using sources from GitHub: https://github.com/getredash/redash/tree/v8.0.0

@levko

Thank you

I try install this (https://redash.io/help/open-source/dev-guide/docker)
So inevitably using sources from GitHub.

I don’t know which file, where, in what format, and version information should be entered.

Just in case anyone stumbles across this as I just did earlier today, I have created a fully self-contained docker-compose file (well with the addition of one env file) here.

Reason being that I found the existing resources a little lacking for just giving Redash a spin. In my believe one should not need to execute a shell script as is done here, nor should one need to perform some extra steps and also have the compose file build images from source as is done in the dev-guide. Ideally it should not even be required to run something like docker-compose run ... which is also required in at least some of the resources available currently.

With the linked repository of mine you truly need to do docker-compose up -d and you are good to go.

Maybe it will help someone some day. Cheers!

2 Likes

Thanks for your contribution and welcome to the forum @max_streese!

I got this working by removing the version tags from redash, redis and postgres images.

Cheers, Mike

version: "2"
x-redash-service: &redash-service
  image: redash/redash #:8.0.0.b32245
  depends_on:
    - postgres
    - redis
  env_file: ./env
services:
  create_db:
    <<: *redash-service
    command: create_db
  server:
    <<: *redash-service
    command: server
    ports:
      - "5000:5000"
    environment:
      REDASH_WEB_WORKERS: 4
    restart: always
  scheduler:
    <<: *redash-service
    command: scheduler
    environment:
      QUEUES: "celery"
      WORKERS_COUNT: 1
    restart: always
  scheduled_worker:
    <<: *redash-service
    command: worker
    environment:
      QUEUES: "scheduled_queries,schemas"
      WORKERS_COUNT: 1
    restart: always
  adhoc_worker:
    <<: *redash-service
    command: worker
    environment:
      QUEUES: "queries"
      WORKERS_COUNT: 2
    restart: always
  redis:
    image: redis #:5.0-alpine
    restart: always
  postgres:
    image: postgres #:9.6-alpine
    env_file: ./env
    restart: always
  nginx:
    image: redash/nginx:latest
    ports:
      - "80:80"
    depends_on:
      - server
    links:
      - server:redash
    restart: always