docker-compose.stage.yaml
version: '3'
services:
reverse-proxy:
image: traefik:v2.2
restart: unless-stopped
env_file: envs/stage.env
command:
- "--api.insecure=false"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.websecure.address=:443"
- "--entrypoints.web.address=:80"
- "--entrypoints.metrics.address=:8081"
- "--entrypoints.web.http.redirections.entryPoint.to=websecure"
- "--entrypoints.web.http.redirections.entryPoint.scheme=https"
- "--certificatesresolvers.server.acme.tlschallenge=true"
- "--certificatesresolvers.server.acme.email=${SERVICE_EMAIL}"
- "--certificatesresolvers.server.acme.storage=/letsencrypt/acme.json"
ports:
- 80:80
- 443:443
- 8081:8081
volumes:
- ./letsencrypt:/letsencrypt
- /var/run/docker.sock:/var/run/docker.sock
server:
image: docker.pkg.github.com/haroldtreen/epub-press/server:stage
depends_on:
- postgres
env_file: envs/stage.env
restart: unless-stopped
labels:
- traefik.enable=true
- traefik.http.routers.epub-press.rule=Host(`${SERVICE_HOST}`)
- traefik.http.routers.epub-press.entrypoints=web,websecure
- traefik.http.routers.epub-press.tls.certresolver=server
- traefik.http.routers.epub-press.tls=true
prometheus:
image: prom/prometheus
restart: unless-stopped
env_file: envs/stage.env
depends_on:
- server
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
labels:
- traefik.enable=true
- traefik.http.routers.metrics.entrypoints=metrics
- traefik.http.routers.metrics.middlewares=auth
- traefik.http.routers.metrics.rule=Host(`${SERVICE_HOST}`)
- traefik.http.middlewares.auth.basicauth.users=${BASIC_AUTH_USERS}
postgres:
image: library/postgres:12
env_file: envs/stage.env
restart: unless-stopped