60 lines
1.5 KiB
YAML
60 lines
1.5 KiB
YAML
# ============================================================
|
|
# Docker Compose — Intranet CHK 2.0
|
|
# Déploiement on-premises / VPS
|
|
# ============================================================
|
|
# Usage :
|
|
# docker compose up -d --build
|
|
# docker compose logs -f
|
|
# docker compose down
|
|
|
|
version: "3.9"
|
|
|
|
services:
|
|
|
|
# ---- Application principale ----
|
|
intranet-chk:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
args:
|
|
VITE_APP_TITLE: "${VITE_APP_TITLE:-Intranet CHK — Centre Hospitalier de Kourou}"
|
|
VITE_APP_ID: "${VITE_APP_ID:-chk-intranet}"
|
|
container_name: intranet-chk
|
|
restart: unless-stopped
|
|
ports:
|
|
- "${APP_PORT:-3000}:3000"
|
|
environment:
|
|
- NODE_ENV=production
|
|
- PORT=3000
|
|
networks:
|
|
- chk-network
|
|
healthcheck:
|
|
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:3000/"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 20s
|
|
|
|
# ---- Reverse proxy Nginx (optionnel, recommandé en production) ----
|
|
nginx:
|
|
image: nginx:alpine
|
|
container_name: intranet-chk-nginx
|
|
restart: unless-stopped
|
|
ports:
|
|
- "80:80"
|
|
- "443:443"
|
|
volumes:
|
|
- ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf:ro
|
|
- ./nginx/ssl:/etc/nginx/ssl:ro # Certificats SSL (Let's Encrypt ou auto-signé)
|
|
- nginx-logs:/var/log/nginx
|
|
depends_on:
|
|
- intranet-chk
|
|
networks:
|
|
- chk-network
|
|
|
|
networks:
|
|
chk-network:
|
|
driver: bridge
|
|
|
|
volumes:
|
|
nginx-logs:
|