98 lines
2.4 KiB
YAML
98 lines
2.4 KiB
YAML
---
|
|
version: "3.8"
|
|
|
|
services:
|
|
app:
|
|
image: 'pretix/standalone:2024.1.0'
|
|
networks:
|
|
- proxy
|
|
- internal
|
|
volumes:
|
|
- app:/data
|
|
configs:
|
|
- source: pretix_config
|
|
target: /etc/pretix/pretix.cfg
|
|
secrets:
|
|
- db_password
|
|
- smtp_password
|
|
- django_secret_key
|
|
deploy:
|
|
restart_policy:
|
|
condition: on-failure
|
|
labels:
|
|
- "traefik.enable=true"
|
|
- "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=80"
|
|
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`${EXTRA_DOMAINS})"
|
|
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
|
|
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
|
|
- "coop-cloud.${STACK_NAME}.version=1.0.0+2024.1.0"
|
|
# healthcheck:
|
|
# test: ["CMD", "curl", "-f", "http://localhost"]
|
|
# interval: 30s
|
|
# timeout: 10s
|
|
# retries: 10
|
|
# start_period: 1m
|
|
|
|
db:
|
|
image: postgres:12
|
|
volumes:
|
|
- "postgres:/var/lib/postgresql/data"
|
|
networks:
|
|
- internal
|
|
environment:
|
|
POSTGRES_USER: pretix
|
|
POSTGRES_PASSWORD_FILE: /run/secrets/db_password
|
|
POSTGRES_DB: pretix
|
|
secrets:
|
|
- db_password
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
deploy:
|
|
labels:
|
|
backupbot.backup: "true"
|
|
backupbot.backup.pre-hook: "PGPASSWORD=$$(cat $${POSTGRES_PASSWORD_FILE}) pg_dump -U $${POSTGRES_USER} $${POSTGRES_DB} > /var/lib/postgresql/data/backup.sql"
|
|
backupbot.backup.post-hook: "rm -rf /var/lib/postgresql/data/backup.sql"
|
|
|
|
redis:
|
|
image: redis:7.0.10-alpine
|
|
volumes:
|
|
- "redis:/data"
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 3s
|
|
timeout: 5s
|
|
retries: 20
|
|
networks:
|
|
- internal
|
|
|
|
volumes:
|
|
app:
|
|
postgres:
|
|
redis:
|
|
|
|
configs:
|
|
pretix_config:
|
|
name: ${STACK_NAME}_pretix_config_${PRETIX_CONFIG_VERSION}
|
|
file: pretix.cfg.tmpl
|
|
template_driver: golang
|
|
|
|
networks:
|
|
proxy:
|
|
external: true
|
|
internal:
|
|
|
|
|
|
secrets:
|
|
db_password:
|
|
external: true
|
|
name: ${STACK_NAME}_db_password_${SECRET_DB_PASSWORD_VERSION}
|
|
smtp_password:
|
|
external: true
|
|
name: ${STACK_NAME}_smtp_password_${SECRET_SMTP_PASSWORD_VERSION}
|
|
django_secret_key:
|
|
external: true
|
|
name: ${STACK_NAME}_django_secret_key_${SECRET_DJANGO_SECRET_KEY_VERSION}
|