准备docker-compose.yml
version: '2'
services:
server:
image: redash/redash:8.0.2.b37747
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: "suibianxieyige"
REDASH_WEB_WORKERS: 4
REDASH_MAIL_SERVER: "smtp.exmail.qq.com"
REDASH_MAIL_PORT: 465
REDASH_MAIL_USE_TLS: "true"
REDASH_MAIL_USE_SSL: "true"
REDASH_MAIL_USERNAME: "[email protected]"
REDASH_MAIL_PASSWORD: "xxx"
REDASH_MAIL_DEFAULT_SENDER: "[email protected]"
REDASH_HOST: "http://xxx.com"
REDASH_ADDITIONAL_QUERY_RUNNERS: "redash.query_runner.python"
restart: always
worker:
image: redash/redash:8.0.2.b37747
command: scheduler
environment:
PYTHONUNBUFFERED: 0
REDASH_LOG_LEVEL: "INFO"
REDASH_REDIS_URL: "redis://redis:6379/0"
REDASH_DATABASE_URL: "postgresql://postgres@postgres/postgres"
REDASH_COOKIE_SECRET: "xxx"
REDASH_ADDITIONAL_QUERY_RUNNERS: "redash.query_runner.python"
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
初始化数据库
docker-compose run --rm server create_db
启动服务
docker-compose up -d
Nginx代理
upstream rd_server {
server 172.28.51.191:5000;
}
server{
listen 80;
# 此域名是提供给最终用户的访问地址
server_name xxx.com;
access_log /var/log/nginx/rd.access.log;
gzip on;
gzip_types *;
gzip_proxied any;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://rd_server/;
}
}
标签:postgres,redis,redash,server,Redash,MAIL,Docker,REDASH,搭建
From: https://www.cnblogs.com/nickhan/p/17931392.html