fix: update docker-compose to use shared postgres and Traefik labels

This commit is contained in:
Christopher Mayor
2026-04-26 22:16:24 -07:00
parent 370fd2d8e6
commit 56b6f67d00

View File

@@ -1,30 +1,24 @@
version: "3.8"
services: services:
app: app:
build: . build: .
ports: container_name: comparaison
- "3000:3000"
environment:
- DATABASE_URL=postgresql://postgres:postgres@db:5432/comparaison
depends_on:
db:
condition: service_healthy
restart: unless-stopped restart: unless-stopped
db:
image: postgres:16-alpine
environment: environment:
POSTGRES_USER: postgres - DATABASE_URL=postgresql://bear:changeme@postgres-shared:5432/comparaison
POSTGRES_PASSWORD: postgres - BETTER_AUTH_SECRET=Y6oPTrn3adCnf+Bx60/4g3KjuBfLGVJJB9NFKR5bbVk=
POSTGRES_DB: comparaison - BETTER_AUTH_URL=https://comparaison.local.tophermayor.com
ports: - NODE_ENV=production
- "5432:5432" networks:
volumes: - proxy-net
- pgdata:/var/lib/postgresql/data labels:
healthcheck: - "traefik.enable=true"
test: ["CMD-SHELL", "pg_isready -U postgres"] - "traefik.http.routers.comparaison.rule=Host(`comparaison.local.tophermayor.com`)"
interval: 5s - "traefik.http.routers.comparaison.entrypoints=websecure"
timeout: 5s - "traefik.http.routers.comparaison.tls=true"
retries: 5 - "traefik.http.routers.comparaison.tls.certresolver=cloudflare"
restart: unless-stopped - "traefik.http.routers.comparaison.middlewares=local-only@file"
volumes: - "traefik.http.services.comparaison.loadbalancer.server.port=3000"
pgdata:
networks:
proxy-net:
external: true