202 lines
5.2 KiB
YAML
202 lines
5.2 KiB
YAML
x-superset-image: &superset-image apachesuperset.docker.scarf.sh/apache/superset:${TAG:-latest-dev}
|
|
x-superset-build:
|
|
&superset-build
|
|
context: docker
|
|
x-superset-volumes:
|
|
&superset-volumes # /app/pythonpath_docker will be appended to the PYTHONPATH in the final container
|
|
- ./docker:/app/docker
|
|
- superset_home:/app/superset_home
|
|
|
|
services:
|
|
redis:
|
|
image: redis:7
|
|
container_name: superset_cache
|
|
restart: unless-stopped
|
|
volumes:
|
|
- redis:/data
|
|
|
|
superset:
|
|
env_file:
|
|
- path: docker/.env # default
|
|
required: true
|
|
- path: docker/.env-local # optional override
|
|
required: false
|
|
build: *superset-build
|
|
command: ["run-server.sh"]
|
|
container_name: superset_app
|
|
user: "root"
|
|
restart: unless-stopped
|
|
ports:
|
|
- 8088:8088
|
|
depends_on:
|
|
superset-init:
|
|
condition: service_completed_successfully
|
|
volumes: *superset-volumes
|
|
environment:
|
|
SUPERSET_LOG_LEVEL: "${SUPERSET_LOG_LEVEL:-info}"
|
|
|
|
superset-init:
|
|
build: *superset-build
|
|
command: ["init_superset.sh"]
|
|
container_name: superset_init
|
|
env_file:
|
|
- path: docker/.env # default
|
|
required: true
|
|
- path: docker/.env-local # optional override
|
|
required: false
|
|
depends_on:
|
|
postgres:
|
|
condition: service_started
|
|
redis:
|
|
condition: service_started
|
|
user: "root"
|
|
volumes: *superset-volumes
|
|
healthcheck:
|
|
disable: true
|
|
environment:
|
|
SUPERSET_LOAD_EXAMPLES: "${SUPERSET_LOAD_EXAMPLES:-no}"
|
|
SUPERSET_LOG_LEVEL: "${SUPERSET_LOG_LEVEL:-info}"
|
|
|
|
superset-worker:
|
|
build: *superset-build
|
|
container_name: superset_worker
|
|
command:
|
|
- celery
|
|
- --app=superset.tasks.celery_app:app
|
|
- worker
|
|
- -O
|
|
- fair
|
|
- -l
|
|
- INFO
|
|
- --concurrency=2
|
|
env_file:
|
|
- path: docker/.env # default
|
|
required: true
|
|
- path: docker/.env-local # optional override
|
|
required: false
|
|
restart: unless-stopped
|
|
depends_on:
|
|
superset-init:
|
|
condition: service_completed_successfully
|
|
user: "root"
|
|
volumes: *superset-volumes
|
|
healthcheck:
|
|
test:
|
|
[
|
|
"CMD-SHELL",
|
|
"celery -A superset.tasks.celery_app:app inspect ping -d celery@$$HOSTNAME",
|
|
]
|
|
environment:
|
|
SUPERSET_LOG_LEVEL: "${SUPERSET_LOG_LEVEL:-info}"
|
|
|
|
superset-worker-beat:
|
|
build: *superset-build
|
|
container_name: superset_worker_beat
|
|
command:
|
|
- celery
|
|
- --app=superset.tasks.celery_app:app
|
|
- beat
|
|
- --pidfile
|
|
- /tmp/celerybeat.pid
|
|
- -l
|
|
- INFO
|
|
- -s
|
|
- /tmp/celerybeat-schedule
|
|
env_file:
|
|
- path: docker/.env # default
|
|
required: true
|
|
- path: docker/.env-local # optional override
|
|
required: false
|
|
restart: unless-stopped
|
|
depends_on:
|
|
superset-init:
|
|
condition: service_completed_successfully
|
|
user: "root"
|
|
volumes: *superset-volumes
|
|
healthcheck:
|
|
disable: true
|
|
environment:
|
|
SUPERSET_LOG_LEVEL: "${SUPERSET_LOG_LEVEL:-info}"
|
|
|
|
postgres:
|
|
image: postgres:17-alpine
|
|
container_name: postgres
|
|
hostname: postgres
|
|
env_file:
|
|
- path: docker/.env # default
|
|
required: true
|
|
- path: docker/.env-local # optional override
|
|
required: false
|
|
environment:
|
|
POSTGRES_USER: ${POSTGRES_USER:-postgres}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?database password required}
|
|
POSTGRES_DB: ${POSTGRES_DB:-app}
|
|
PGDATA: /var/lib/postgresql/data/pgdata
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data/pgdata # Persistent data storage
|
|
- ./init:/docker-entrypoint-initdb.d/ # Initialization scripts
|
|
- ./backup:/backup # Backup location
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres}"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 30s
|
|
shm_size: 256mb
|
|
command:
|
|
- "postgres"
|
|
- "-c"
|
|
- "max_connections=200"
|
|
- "-c"
|
|
- "shared_buffers=1GB"
|
|
- "-c"
|
|
- "effective_cache_size=3GB"
|
|
- "-c"
|
|
- "work_mem=16MB"
|
|
- "-c"
|
|
- "maintenance_work_mem=512MB"
|
|
- "-c"
|
|
- "random_page_cost=1.1"
|
|
- "-c"
|
|
- "temp_file_limit=10GB"
|
|
- "-c"
|
|
- "log_min_duration_statement=200ms"
|
|
- "-c"
|
|
- "idle_in_transaction_session_timeout=10s"
|
|
- "-c"
|
|
- "lock_timeout=1s"
|
|
- "-c"
|
|
- "statement_timeout=60s"
|
|
- "-c"
|
|
- "shared_preload_libraries=pg_stat_statements"
|
|
- "-c"
|
|
- "pg_stat_statements.max=10000"
|
|
- "-c"
|
|
- "pg_stat_statements.track=all"
|
|
|
|
pgbackups:
|
|
image: prodrigestivill/postgres-backup-local
|
|
container_name: postgres_backup
|
|
restart: unless-stopped
|
|
volumes:
|
|
- ./data/backup:/backups
|
|
environment:
|
|
- POSTGRES_HOST=postgres
|
|
- POSTGRES_DB=${POSTGRES_DB:-app}
|
|
- POSTGRES_USER=${POSTGRES_USER:-postgres}
|
|
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:?database password required}
|
|
- SCHEDULE=@daily
|
|
- BACKUP_KEEP_DAYS=7
|
|
- BACKUP_KEEP_WEEKS=4
|
|
- BACKUP_KEEP_MONTHS=6
|
|
depends_on:
|
|
- postgres
|
|
|
|
volumes:
|
|
postgres_data:
|
|
name: postgres_data
|
|
superset_home:
|
|
external: false
|
|
redis:
|
|
external: false
|