Files
2026-09-17 12:59:36 +01:00

109 lines
3.7 KiB
YAML

---
version: "3.8"
services:
app:
# The `slim` image variant carries no embedded PostgreSQL. Use compose.db.postgres.yml for a database, or point DATABASE_URL at your own.
image: ${CONTAINER_REGISTRY:-luka1thb/tymeslot}:${APP_VERSION:-1.15.7}-slim
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "10"
environment:
- DEPLOYMENT_TYPE=docker
- PHX_HOST=${DOMAIN}
- URL_SCHEME=https
- PORT=4000
- WS_ALLOWED_ORIGINS
- REGISTRATION_ENABLED
- PASSWORD_AUTH_ENABLED
- DNS_CLUSTER_QUERY
- DOCS_ARTICLE_BASE_URL
- DATABASE_POOL_SIZE
- DATABASE_SSL
- DATABASE_SSL_CACERT_FILE
- EMAIL_ADAPTER
- EMAIL_FROM_NAME
- EMAIL_FROM_ADDRESS
- EMAIL_SUPPORT_ADDRESS
- EMAIL_CONTACT_RECIPIENT
- ADMIN_ALERTS_ENABLED
- ADMIN_ALERT_EMAIL
# Where Google and Microsoft push calendar changes. Defaults to the app's own domain, which is right for any instance Traefik serves publicly; without it calendar sync falls back to polling every 15 minutes.
# Set it empty in your env file if this host is not publicly reachable: note the single dash, so an explicitly empty value is respected and only an unset one falls back to the domain.
- WEBHOOK_BASE_URL=${WEBHOOK_BASE_URL-https://${DOMAIN}}
- TRUST_PRIVATE_CLIENT_IPS
- ALLOW_PRIVATE_IPS_FOR_CALENDAR
- ALLOW_PRIVATE_IPS_FOR_VIDEO
- ALLOW_PRIVATE_IPS_FOR_WEBHOOKS
- HTTP_PROXY
- HTTPS_PROXY
- NO_PROXY
- LOG_FILE_PATH
- LOG_FILE_MAX_BYTES
- LOG_FILE_MAX_FILES
secrets:
- secret_key_base
- data_encryption_key
volumes:
- app-data:/app/data
networks:
- proxy
- internal
entrypoint: ["/docker-entrypoint.sh", "/app/start-docker.sh"]
configs:
- source: app_entrypoint
target: /docker-entrypoint.sh
mode: 0555
deploy:
restart_policy:
# Swarm has no `depends_on: condition: service_healthy`, so on a cold start the app exits until the db accepts connections. That is the intended behaviour; it settles within a few restarts.
condition: on-failure
labels:
# how long abra waits for the deploy to converge, as needs headroom for the Ecto migrations start-docker.sh runs before booting the endpoint
- "coop-cloud.${STACK_NAME}.timeout=${TIMEOUT:-300}"
- "backupbot.backup=${ENABLE_BACKUPS:-true}"
- "traefik.enable=true"
- "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=4000"
- "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=0.1.0+1.15.7"
healthcheck:
# The slim image ships no curl and no wget, so this opens a TCP connection with bash instead. The app does serve GET /healthcheck if you want to upgrade this to a real HTTP probe written against /dev/tcp.
test: ["CMD", "bash", "-c", "exec 3<>/dev/tcp/127.0.0.1/4000"]
interval: 30s
timeout: 10s
retries: 10
start_period: 60s
volumes:
app-data:
networks:
proxy:
external: true
internal:
configs:
app_entrypoint:
name: ${STACK_NAME}_app_entrypoint_${APP_ENTRYPOINT_VERSION:-v1}
file: entrypoint.sh.tmpl
template_driver: golang
secrets:
secret_key_base:
external: true
name: ${STACK_NAME}_secret_key_base_${SECRET_SECRET_KEY_BASE_VERSION:-v1}
data_encryption_key:
external: true
name: ${STACK_NAME}_data_encryption_key_${SECRET_DATA_ENCRYPTION_KEY_VERSION:-v1}