Skip to content

Instantly share code, notes, and snippets.

@thenets
Created August 25, 2018 02:22
Show Gist options
  • Save thenets/0e010ad51fd1cfe2f12775fc46b62d95 to your computer and use it in GitHub Desktop.
Save thenets/0e010ad51fd1cfe2f12775fc46b62d95 to your computer and use it in GitHub Desktop.
Redash 4.0.1 - Docker Compose file
version: '2'
services:
server:
image: redash/redash:4.0.1.b4038
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: veryverysecret
REDASH_WEB_WORKERS: 4
restart: always
worker:
image: redash/redash:4.0.1.b4038
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
restart: always
postgres:
image: postgres:9.5.6-alpine
volumes:
- /opt/redash-postgres:/var/lib/postgresql/data
restart: always
nginx:
image: redash/nginx:latest
ports:
- "80:80"
depends_on:
- server
links:
- server:redash
restart: always
@thenets
Copy link
Author

thenets commented Aug 25, 2018

Script to automate install Redash and expose to port 80:

#!/bin/bash

# Install dependencies
apt-get update
apt-get install -y curl git
curl -sSL https://get.docker.com | sh
apt-get install -y docker-compose

# Download Docker Compose file
curl https://gist.githubusercontent.com/thenets/0e010ad51fd1cfe2f12775fc46b62d95/raw/fb2f612cb58baaa063f2530c643b5cadae2a74bf/redash-compose.yml --output docker-compose.yml
NEW_SECRET=$(openssl rand -base64 32) 
sed -i.bak s/veryverysecret/$NEW_SECRET/g docker-compose.yml

# Start containers from 'docker-compose.yml'
docker-compose up -d
sleep 120
docker-compose run --rm server create_db
sleep 120
docker-compose up -d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment