92 lines
3.4 KiB
YAML
92 lines
3.4 KiB
YAML
# ProxmoxPanel — Docker Compose
|
|
# Démarrage : docker-compose up --build
|
|
# Accès : http://localhost (port 80) ou https://panel.geronzi.fr via Traefik
|
|
|
|
services:
|
|
|
|
# ── Backend Go (API + WebSocket) ────────────────────────────────────────
|
|
backend:
|
|
build:
|
|
context: ./backend
|
|
dockerfile: Dockerfile
|
|
|
|
container_name: proxmoxpanel-backend
|
|
restart: unless-stopped
|
|
expose:
|
|
- "3001"
|
|
volumes:
|
|
# Volume persistant pour SQLite, clés JWT, clé maître AES
|
|
- panel-data:/app/data
|
|
# Socket Docker — permet au backend de reconstruire son propre container lors d'un install de module
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
group_add:
|
|
# GID du groupe docker sur l'hôte (docker group = accès au socket).
|
|
# Trouver avec : getent group docker | cut -d: -f3
|
|
# Surcharger avec : DOCKER_GID=xxx docker compose up -d
|
|
- "${DOCKER_GID:-999}"
|
|
environment:
|
|
- DATA_DIR=/app/data
|
|
- LISTEN_ADDR=:3001
|
|
- APP_ENV=production
|
|
# Identité de ce container (utilisé pour l'auto-rebuild des modules)
|
|
- CONTAINER_NAME=proxmoxpanel-backend
|
|
# Repo git du CORE (pour docker build --remote lors d'un install module)
|
|
- GIT_REPO=https://git.geronzi.fr/proxmoxPanel/core.git
|
|
# Branche git à utiliser pour le rebuild
|
|
- GIT_BRANCH=frontend/alpine
|
|
# Tag de l'image Docker construite
|
|
- IMAGE_TAG=proxmoxpanel-backend:latest
|
|
# Registry Forgejo — surcharger si auto-hébergé ailleurs
|
|
- FORGEJO_URL=https://git.geronzi.fr
|
|
- FORGEJO_ORG=proxmoxPanel
|
|
# Pas de réseau host — le container reste isolé
|
|
# Les connexions SSH sortantes vers le host Proxmox sont autorisées via le réseau Docker
|
|
networks:
|
|
- proxmoxpanel-net
|
|
# Limite de ressources recommandées
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
memory: 256M
|
|
cpus: "1.0"
|
|
healthcheck:
|
|
test: ["CMD", "wget", "-qO-", "http://localhost:3001/api/health"]
|
|
interval: 30s
|
|
timeout: 5s
|
|
retries: 3
|
|
start_period: 10s
|
|
|
|
# ── Frontend Vue 3 (Nginx + assets statiques) ───────────────────────────
|
|
frontend:
|
|
build:
|
|
context: ./frontend
|
|
dockerfile: Dockerfile
|
|
container_name: proxmoxpanel-frontend
|
|
restart: unless-stopped
|
|
ports:
|
|
# En développement local : http://localhost:80
|
|
# En production : Traefik se charge du port 443 → ce port est juste pour accès direct
|
|
- "80:80"
|
|
depends_on:
|
|
backend:
|
|
condition: service_healthy
|
|
networks:
|
|
- proxmoxpanel-net
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
memory: 64M
|
|
cpus: "0.5"
|
|
|
|
# ── Volumes ────────────────────────────────────────────────────────────────
|
|
volumes:
|
|
# Données persistantes : SQLite + clés cryptographiques
|
|
# NE PAS supprimer ce volume sans sauvegarder panel.db au préalable
|
|
panel-data:
|
|
name: proxmoxpanel-data
|
|
|
|
# ── Réseaux ────────────────────────────────────────────────────────────────
|
|
networks:
|
|
proxmoxpanel-net:
|
|
name: proxmoxpanel-net
|
|
driver: bridge
|