# This is an example configuration for Docker Compose. Make sure to atleast update # the cookie secret & postgres database password. # # Some other recommendations: # 1. To persist Postgres data, assign it a volume host location. # 2. Split the worker service to adhoc workers and scheduled queries workers. version: '2' services: server: image: redash/redash:latest command: server depends_on: - postgres - redis ports: - "5000:5000" environment: PYTHONUNBUFFERED: 0 REDASH_LOG_LEVEL: "INFO" REDASH_REDIS_URL: "redis://redis:6379/0" REDASH_DATABASE_URL: "postgresql://postgres@postgres/postgres" REDASH_COOKIE_SECRET: "Q422k6vaXUk8" REDASH_WEB_WORKERS: 4 restart: always worker: image: redash/redash:latest command: scheduler 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,celery" WORKERS_COUNT: 2 restart: always redis: image: redis:3.0-alpine ports: - "6379:6379" volumes: - ./data/redis_data:/data restart: always postgres: image: postgres:9.5.6-alpine ports: - "5432:5432" volumes: - ./data/postgresql_data:/var/lib/postgresql/data restart: always nginx: image: redash/nginx:latest ports: - "88:80" depends_on: - server links: - server:redash restart: always
2,创建db
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
[root@VM_38_115_centos redash]# docker-compose -f docker-compose.production.yml run --rm server create_db Starting redash_redis_1 Starting redash_postgres_1 [2018-09-11 09:02:39,580][PID:1][INFO][root] Generating grammar tables from /usr/lib/python2.7/lib2to3/Grammar.txt [2018-09-11 09:02:39,601][PID:1][INFO][root] Generating grammar tables from /usr/lib/python2.7/lib2to3/PatternGrammar.txt [2018-09-11 09:02:41,707][PID:1][INFO][alembic.runtime.migration] Context impl PostgresqlImpl. [2018-09-11 09:02:41,708][PID:1][INFO][alembic.runtime.migration] Will assume transactional DDL. [2018-09-11 09:02:41,724][PID:1][INFO][alembic.runtime.migration] Running stamp_revision -> 969126bd800f
3,运行
1
# docker-compose -f docker-compose.production.yml up
运行起来的容器如下:
4,邮件配置
For the system to be able to send emails (for example when alerts trigger), you need to set the mail server to use and the host name of your Redash server. If you’re using one of our images, you can do this by editing the .env file:
1 2 3 4 5 6 7 8 9 10 11 12
# Note that not all values are required, as they have default values. export REDASH_MAIL_SERVER="" # default: localhost export REDASH_MAIL_PORT="" # default: 25 export REDASH_MAIL_USE_TLS="" # default: false export REDASH_MAIL_USE_SSL="" # default: false export REDASH_MAIL_USERNAME="" # default: None export REDASH_MAIL_PASSWORD="" # default: None export REDASH_MAIL_DEFAULT_SENDER="" # Email address to send from export REDASH_HOST="" # base address of your Redash instance, for example: "https://demo.redash.io"