54 lines
1.6 KiB
YAML
54 lines
1.6 KiB
YAML
services:
|
|
|
|
# ── PostgreSQL ──────────────────────────────────────────────
|
|
db:
|
|
image: postgres:16-alpine
|
|
environment:
|
|
POSTGRES_DB: notesfrais
|
|
POSTGRES_USER: notesfrais
|
|
POSTGRES_PASSWORD: ${DB_PASSWORD}
|
|
volumes:
|
|
- pgdata:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U notesfrais -d notesfrais"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 12
|
|
restart: unless-stopped
|
|
|
|
# ── Backend Express ─────────────────────────────────────────
|
|
backend:
|
|
build:
|
|
context: ./backend
|
|
dockerfile: Dockerfile
|
|
environment:
|
|
NODE_ENV: production
|
|
PORT: 3001
|
|
DATABASE_URL: postgresql://notesfrais:${DB_PASSWORD}@db:5432/notesfrais
|
|
JWT_SECRET: ${JWT_SECRET}
|
|
APP_SECRET: ${APP_SECRET}
|
|
UPLOADS_DIR: /app/uploads
|
|
FRONTEND_URL: https://${DOMAIN:-frais.domench.fr}
|
|
volumes:
|
|
- uploads:/app/uploads
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
restart: unless-stopped
|
|
|
|
# ── Frontend nginx ──────────────────────────────────────────
|
|
frontend:
|
|
build:
|
|
context: ./frontend
|
|
dockerfile: Dockerfile
|
|
depends_on:
|
|
- backend
|
|
restart: unless-stopped
|
|
# Coolify/Traefik gère le routage HTTPS — pas de binding direct sur le port hôte.
|
|
expose:
|
|
- "80"
|
|
|
|
volumes:
|
|
pgdata:
|
|
uploads:
|