Files
thoughts/compose.prod.yml
Gabriel Kaszewski 9207572f07
All checks were successful
Build and Deploy Thoughts / build-and-deploy-local (push) Successful in 5s
fix: remove redundant volume mapping for proxy service
2025-09-09 01:44:01 +02:00

76 lines
1.9 KiB
YAML

services:
database:
image: postgres:15-alpine
container_name: thoughts-db
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 10s
timeout: 5s
retries: 5
networks:
- internal
backend:
container_name: thoughts-backend
image: thoughts-backend:latest
restart: unless-stopped
environment:
- RUST_LOG=info
- RUST_BACKTRACE=1
- DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@database/${POSTGRES_DB}
- HOST=0.0.0.0
- PORT=8000
- PREFORK=1
- AUTH_SECRET=${AUTH_SECRET}
- BASE_URL=https://thoughts.gabrielkaszewski.dev
depends_on:
database:
condition: service_healthy
networks:
- internal
frontend:
container_name: thoughts-frontend
image: thoughts-frontend:latest
restart: unless-stopped
depends_on:
- backend
environment:
- NEXT_PUBLIC_SERVER_SIDE_API_URL=http://proxy/api
networks:
- internal
proxy:
container_name: thoughts-proxy
image: custom-proxy:latest
restart: unless-stopped
depends_on:
- frontend
- backend
networks:
- internal
- traefik
labels:
- "traefik.enable=true"
- "traefik.http.routers.thoughts.rule=Host(`thoughts.gabrielkaszewski.dev`)"
- "traefik.http.routers.thoughts.entrypoints=web,websecure"
- "traefik.http.routers.thoughts.tls.certresolver=letsencrypt"
- "traefik.http.routers.thoughts.service=thoughts"
- "traefik.http.services.thoughts.loadbalancer.server.port=80"
volumes:
postgres_data:
driver: local
networks:
traefik:
external: true
internal:
driver: bridge