Configuration portable : chemins relatifs et API dynamique

This commit is contained in:
2026-02-05 18:30:35 +01:00
parent 8b905dc9b3
commit 53869a6626
6 changed files with 195 additions and 16 deletions

View File

@@ -6,21 +6,26 @@ services:
context: .
dockerfile: Dockerfile
container_name: webnationsglory-admin
env_file:
- .env
environment:
NODE_ENV: production
PORT: 4001
SERVER_DIR: /home/innotex/NationsGloryRED/NationsGlory_ServeurBuild_Red
RCON_HOST: localhost
RCON_PORT: 25575
SESSION_SECRET: your-secret-key-change-in-production
NODE_ENV: ${NODE_ENV:-production}
PORT: ${PORT:-4001}
SERVER_DIR: /mc-server
RCON_HOST: ${RCON_HOST:-localhost}
RCON_PORT: ${RCON_PORT:-25575}
RCON_PASSWORD: ${RCON_PASSWORD:-minecraft}
SESSION_SECRET: ${SESSION_SECRET:-your-secret-key-change-in-production}
volumes:
- /home/innotex/NationsGloryRED/NationsGlory_ServeurBuild_Red:/mc-server
# Montage relatif du serveur MC (depuis le dossier parent)
- ${MC_SERVER_PATH:-../NationsGlory_ServeurBuild_Red}:/mc-server:ro
- web-admin-data:/app/data
ports:
- "4001:4001"
- "${PORT:-4001}:${PORT:-4001}"
network_mode: host
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:4001/api/health"]
test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:${PORT:-4001}/api/health || exit 1"]
interval: 30s
timeout: 10s
retries: 3