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