- Dockerfiles: server (Bun, runs migrations then starts) and web (Vite build served by nginx with SPA fallback); .dockerignore - docker-compose.prod.yml (postgres + server + web) ready for Dokploy, with uploads/pgdata volumes and .env.production.example - README: deployment (Dokploy) + gitflow/versioning sections, Images mode, bots, i18n; CHANGELOG.md - bump packages to 0.1.0 Docker images built and validated end-to-end: server migrates + serves /health + /api/categories; web serves the SPA with VITE_SERVER_URL baked in. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
60 lines
1.7 KiB
YAML
60 lines
1.7 KiB
YAML
# Stack de production NerdWare (postgres + serveur + client).
|
|
# Pensé pour Dokploy (assigne les domaines via Traefik) ou un `docker compose up`.
|
|
#
|
|
# Variables attendues (UI Dokploy ou fichier .env à côté de ce fichier) :
|
|
# POSTGRES_PASSWORD mot de passe Postgres
|
|
# ADMIN_TOKEN jeton du back-office quiz
|
|
# CORS_ORIGINS domaine(s) du client, ex. https://nerdware.example.com
|
|
# VITE_SERVER_URL URL publique du serveur, ex. https://api.nerdware.example.com
|
|
services:
|
|
postgres:
|
|
image: postgres:17-alpine
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_USER: ${POSTGRES_USER:-nerdware}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-nerdware}
|
|
POSTGRES_DB: ${POSTGRES_DB:-nerdware}
|
|
volumes:
|
|
- pgdata:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-nerdware} -d ${POSTGRES_DB:-nerdware}"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
server:
|
|
build:
|
|
context: .
|
|
dockerfile: apps/server/Dockerfile
|
|
restart: unless-stopped
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
environment:
|
|
NODE_ENV: production
|
|
HOST: 0.0.0.0
|
|
PORT: 3001
|
|
DATABASE_URL: postgres://${POSTGRES_USER:-nerdware}:${POSTGRES_PASSWORD:-nerdware}@postgres:5432/${POSTGRES_DB:-nerdware}
|
|
ADMIN_TOKEN: ${ADMIN_TOKEN}
|
|
CORS_ORIGINS: ${CORS_ORIGINS}
|
|
UPLOADS_DIR: /data/uploads
|
|
volumes:
|
|
- uploads:/data/uploads
|
|
expose:
|
|
- "3001"
|
|
|
|
web:
|
|
build:
|
|
context: .
|
|
dockerfile: apps/web/Dockerfile
|
|
args:
|
|
VITE_SERVER_URL: ${VITE_SERVER_URL}
|
|
restart: unless-stopped
|
|
depends_on:
|
|
- server
|
|
expose:
|
|
- "80"
|
|
|
|
volumes:
|
|
pgdata:
|
|
uploads:
|