Skip to content

Commit

Permalink
fix redash
Browse files Browse the repository at this point in the history
  • Loading branch information
chendelin1982 authored Mar 7, 2024
1 parent 667fd79 commit fe3c7ab
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 21 deletions.
25 changes: 22 additions & 3 deletions apps/redash/.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@

W9_NAME=redash
W9_DIST=community
W9_REPO=redash/redash
W9_VERSION=latest
W9_HTTP_PORT=9001
W9_POWER_PASSWORD=1PrMxExC45LsCT

W9_ID=redash
W9_HTTP_PORT_SET=9001
W9_HTTP_PORT=5000

W9_URL=appname.example.com

W9_NETWORK=websoft9

# environments from Redash
# refer to: https://github.com/getredash/setup/blob/master/setup.sh
# refer to: https://redash.io/help/open-source/setup#-Setup

PYTHONUNBUFFERED=0
REDASH_LOG_LEVEL=INFO
REDASH_REDIS_URL=redis://${W9_ID}-redis:6379/0
POSTGRES_PASSWORD=$W9_POWER_PASSWORD
REDASH_COOKIE_SECRET=$W9_POWER_PASSWORD
REDASH_SECRET_KEY=$W9_POWER_PASSWORD
REDASH_DATABASE_URL="postgresql://postgres:${POSTGRES_PASSWORD}@postgres/postgres"
9 changes: 8 additions & 1 deletion apps/redash/Notes.md
Original file line number Diff line number Diff line change
@@ -1 +1,8 @@
# Redash
# Redash

- environments is get from setup.sh
- after docker compose up, should run at redash container (the same with 【sudo docker-compose run --rm server create_db】), why?
```
./manage.py database create_tables
```
- Nginx container is not need
41 changes: 24 additions & 17 deletions apps/redash/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,59 +1,66 @@
# compose from: https://github.com/getredash/setup/blob/master/data/docker-compose.yml
# compose: https://github.com/getredash/setup/blob/master/data/docker-compose.yml
# image: https://hub.docker.com/r/redash/redash
# docs: https://github.com/getredash/setup/blob/master/setup.sh

version: "3.8"
x-redash-service: &redash-service
image: redash/redash:8.0.0.b32245
image: ${W9_REPO}:${W9_VERSION}
depends_on:
- postgres
- redis
env_file: /opt/redash/env
restart: always
env_file: .env
restart: unless-stopped

services:
server:
<<: *redash-service
command: server
container_name: ${W9_ID}
ports:
- "5000:5000"
- ${W9_HTTP_PORT_SET}:5000
environment:
REDASH_WEB_WORKERS: 4

scheduler:
<<: *redash-service
command: scheduler
environment:
QUEUES: "celery"
WORKERS_COUNT: 1

scheduled_worker:
<<: *redash-service
command: worker
environment:
QUEUES: "scheduled_queries,schemas"
WORKERS_COUNT: 1
WORKERS_COUNT:

adhoc_worker:
<<: *redash-service
command: worker
environment:
QUEUES: "queries"
WORKERS_COUNT: 2

redis:
image: redis:5.0-alpine
container_name: ${W9_ID}-redis
restart: always
volumes:
- redis:/data

postgres:
image: postgres:9.6-alpine
env_file: /opt/redash/env
container_name: ${W9_ID}-postgres
env_file: .env
volumes:
- /opt/redash/postgres-data:/var/lib/postgresql/data
restart: always
nginx:
image: redash/nginx:latest
ports:
- "80:80"
depends_on:
- server
links:
- server:redash
- postgres:/var/lib/postgresql/data
restart: always

volumes:
postgres:
redis:

networks:
default:
name: ${W9_NETWORK}
Expand Down

0 comments on commit fe3c7ab

Please sign in to comment.