mirror of
https://github.com/R0m1k3/PleinR.git
synced 2026-10-11 17:27:54 +02:00
Application unique Next.js (App Router, TypeScript) servant : - Accueil public : héro, recherche, métiers, promotions, mises à l'honneur (données issues de Postgres) - Backend authentifié avec RBAC : tableau de bord, adhérents (CRUD), modération des promotions, administrateurs, espace adhérent (publication avec aperçu) Technique : - Drizzle ORM + drizzle-kit (migrations versionnées) sur driver pg - Auth.js v5 (credentials, sessions JWT), rôles admin/moderator/editor/member - Middleware de protection de /backend + gardes par rôle dans chaque vue - Server actions pour toutes les mutations (vérif auth + capacité + revalidate) - Design fidèle aux maquettes (design-system CSS, animations, responsive) Conteneurisation : - 1 conteneur applicatif (sortie standalone) + 1 conteneur Postgres externe - docker-compose avec healthcheck ; migrations + seed au démarrage - scripts migrate/seed bundlés (esbuild) pour un runtime sans devDeps Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XwfhYHzC9hQWPDnQ2p53GL
46 lines
1.5 KiB
YAML
46 lines
1.5 KiB
YAML
# Plein R — single application container + external Postgres container.
|
|
#
|
|
# The app (Next.js) runs in ONE container. Postgres runs as a SEPARATE
|
|
# (external) container. For a managed/already-existing Postgres, delete the
|
|
# `postgres` service below and point DATABASE_URL at your instance.
|
|
|
|
services:
|
|
postgres:
|
|
image: postgres:16-alpine
|
|
container_name: pleinr-postgres
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_USER: ${POSTGRES_USER:-pleinr}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-pleinr}
|
|
POSTGRES_DB: ${POSTGRES_DB:-pleinr}
|
|
volumes:
|
|
- pgdata:/var/lib/postgresql/data
|
|
ports:
|
|
- "5432:5432"
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-pleinr} -d ${POSTGRES_DB:-pleinr}"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 12
|
|
|
|
app:
|
|
build: .
|
|
container_name: pleinr-app
|
|
restart: unless-stopped
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
environment:
|
|
DATABASE_URL: postgres://${POSTGRES_USER:-pleinr}:${POSTGRES_PASSWORD:-pleinr}@postgres:5432/${POSTGRES_DB:-pleinr}
|
|
AUTH_SECRET: ${AUTH_SECRET:?set AUTH_SECRET in your .env}
|
|
AUTH_URL: ${AUTH_URL:-http://localhost:3000}
|
|
SEED_ON_START: ${SEED_ON_START:-true}
|
|
SEED_ADMIN_EMAIL: ${SEED_ADMIN_EMAIL:-admin@plein-r.fr}
|
|
SEED_ADMIN_PASSWORD: ${SEED_ADMIN_PASSWORD:-changeme123}
|
|
SEED_ADMIN_NAME: ${SEED_ADMIN_NAME:-Administrateur Plein R}
|
|
ports:
|
|
- "3000:3000"
|
|
|
|
volumes:
|
|
pgdata:
|