capsul/compose.yml

55 lines
1.6 KiB
YAML

---
version: "3.8"
services:
app:
image: 3wordchant/capsul-flask:latest
networks:
- proxy
- internal
environment:
- "POSTGRES_CONNECTION_PARAMETERS=host=db port=5432 user=capsul password=capsul dbname=capsul"
- "HUB_MODEL"
- "SPOKE_MODEL"
- "BASE_URL=https://${DOMAIN}"
- "LOG_LEVEL"
- "HUB_URL=http://localhost:5000"
#entrypoint: ['tail', '-f', '/dev/null']
deploy:
restart_policy:
condition: on-failure
labels:
- "traefik.enable=true"
- "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=5000"
- "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}"
## Redirect from EXTRA_DOMAINS to DOMAIN
#- "traefik.http.routers.${STACK_NAME}.middlewares=${STACK_NAME}-redirect"
#- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLForceHost=true"
#- "traefik.http.middlewares.${STACK_NAME}-redirect.headers.SSLHost=${DOMAIN}"
# healthcheck:
# test: ["CMD", "wget", "--tries=1", "http://localhost:5000", "-O", "/dev/null"]
# interval: 30s
# timeout: 10s
# retries: 10
# start_period: 1m
db:
image: "postgres:9.6.5"
networks:
- internal
volumes:
- "postgres:/var/lib/postgresql/data"
environment:
POSTGRES_USER: capsul
POSTGRES_PASSWORD: capsul
POSTGRES_DB: capsul
networks:
proxy:
external: true
internal:
volumes:
postgres: