mirror of
https://github.com/R0m1k3/PleinR.git
synced 2026-10-11 17:27:54 +02:00
Le compose ne requiert plus AUTH_SECRET (`:?` retiré). Si la variable est vide, docker-entrypoint.sh génère un secret aléatoire et le persiste dans le volume app-data (/app/data/auth_secret), réutilisé aux redémarrages. Surcharge possible en définissant AUTH_SECRET. Déploiement Portainer sans configuration requise. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XwfhYHzC9hQWPDnQ2p53GL
54 lines
1.9 KiB
YAML
54 lines
1.9 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:
|
|
# Host port rarely used (container stays on 5432). Change the left side if needed.
|
|
- "54329: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}
|
|
# Optional: if left empty, the container generates and persists one
|
|
# automatically (see docker-entrypoint.sh + the app-data volume).
|
|
AUTH_SECRET: ${AUTH_SECRET:-}
|
|
AUTH_URL: ${AUTH_URL:-http://localhost:8413}
|
|
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:
|
|
# Host port rarely used (container stays on 3000). App reachable at http://HOST:8413
|
|
- "8413:3000"
|
|
volumes:
|
|
# Persists the auto-generated AUTH_SECRET across restarts.
|
|
- appdata:/app/data
|
|
|
|
volumes:
|
|
pgdata:
|
|
appdata:
|