54 lines
1.6 KiB
YAML
54 lines
1.6 KiB
YAML
services:
|
|
fastify:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
volumes:
|
|
- static:/app/dist
|
|
environment:
|
|
- DATABASE_URL
|
|
- STRIPE_SECRET_KEY
|
|
- STRIPE_WEBHOOK_SECRET
|
|
- DOMAIN
|
|
- PORT=3000
|
|
- ADMIN_EMAIL
|
|
- ADMIN_PASSWORD
|
|
- COOKIE_SECRET
|
|
- NODE_ENV=production
|
|
healthcheck:
|
|
test: ["CMD", "sh", "-c", "[ -f /app/dist/index.html ] && wget -qO- http://localhost:3000/api/health || exit 1"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 60
|
|
start_period: 120s
|
|
restart: unless-stopped
|
|
labels:
|
|
- traefik.enable=true
|
|
- traefik.http.routers.api.rule=Host(`rebours.studio`) && (PathPrefix(`/api`) || PathPrefix(`/admin`))
|
|
- traefik.http.routers.api.entrypoints=https
|
|
- traefik.http.routers.api.tls=true
|
|
- traefik.http.routers.api.tls.certresolver=letsencrypt
|
|
- traefik.http.services.api.loadbalancer.server.port=3000
|
|
- traefik.http.routers.api.priority=2
|
|
|
|
nginx:
|
|
image: nginx:alpine
|
|
volumes:
|
|
- static:/usr/share/nginx/html:ro
|
|
- ./docker/nginx.conf:/etc/nginx/conf.d/default.conf:ro
|
|
depends_on:
|
|
fastify:
|
|
condition: service_healthy
|
|
restart: unless-stopped
|
|
labels:
|
|
- traefik.enable=true
|
|
- traefik.http.routers.static.rule=Host(`rebours.studio`)
|
|
- traefik.http.routers.static.entrypoints=https
|
|
- traefik.http.routers.static.tls=true
|
|
- traefik.http.routers.static.tls.certresolver=letsencrypt
|
|
- traefik.http.services.static.loadbalancer.server.port=80
|
|
- traefik.http.routers.static.priority=1
|
|
|
|
volumes:
|
|
static:
|