124 lines
3.8 KiB
YAML
124 lines
3.8 KiB
YAML
# ──────────────────────────────────────────────────────────────
|
|
# BanGUI — Debug / Development Compose
|
|
#
|
|
# Compatible with:
|
|
# docker compose -f Docker/compose.debug.yml up
|
|
# podman compose -f Docker/compose.debug.yml up
|
|
# podman-compose -f Docker/compose.debug.yml up
|
|
#
|
|
# Features:
|
|
# - Source code mounted as volumes (hot-reload)
|
|
# - Uvicorn --reload for backend auto-restart
|
|
# - Vite dev server for frontend with HMR
|
|
# - Ports exposed on host for direct access
|
|
# - Debug log level enabled
|
|
# ──────────────────────────────────────────────────────────────
|
|
|
|
name: bangui-dev
|
|
|
|
services:
|
|
# ── fail2ban ─────────────────────────────────────────────────
|
|
fail2ban:
|
|
image: lscr.io/linuxserver/fail2ban:latest
|
|
container_name: bangui-fail2ban-dev
|
|
restart: unless-stopped
|
|
cap_add:
|
|
- NET_ADMIN
|
|
- NET_RAW
|
|
network_mode: host
|
|
environment:
|
|
TZ: "${BANGUI_TIMEZONE:-UTC}"
|
|
PUID: 0
|
|
PGID: 0
|
|
volumes:
|
|
- ./fail2ban-dev-config:/config
|
|
- fail2ban-dev-run:/var/run/fail2ban
|
|
- /var/log:/var/log:ro
|
|
healthcheck:
|
|
test: ["CMD", "fail2ban-client", "ping"]
|
|
interval: 15s
|
|
timeout: 5s
|
|
start_period: 15s
|
|
retries: 3
|
|
|
|
# ── Backend (FastAPI + uvicorn with --reload) ───────────────
|
|
backend:
|
|
build:
|
|
context: ..
|
|
dockerfile: Docker/Dockerfile.backend
|
|
target: runtime
|
|
container_name: bangui-backend-dev
|
|
restart: unless-stopped
|
|
user: "0"
|
|
depends_on:
|
|
fail2ban:
|
|
condition: service_healthy
|
|
environment:
|
|
BANGUI_DATABASE_PATH: "/data/bangui.db"
|
|
BANGUI_FAIL2BAN_SOCKET: "/var/run/fail2ban/fail2ban.sock"
|
|
BANGUI_LOG_LEVEL: "debug"
|
|
BANGUI_SESSION_SECRET: "${BANGUI_SESSION_SECRET:-dev-secret-do-not-use-in-production}"
|
|
BANGUI_TIMEZONE: "${BANGUI_TIMEZONE:-UTC}"
|
|
volumes:
|
|
- ../backend/app:/app/app:z
|
|
- ../fail2ban-master:/app/fail2ban-master:ro,z
|
|
- bangui-dev-data:/data
|
|
- fail2ban-dev-run:/var/run/fail2ban:ro
|
|
- fail2ban-dev-config:/config:ro
|
|
ports:
|
|
- "${BANGUI_BACKEND_PORT:-8000}:8000"
|
|
command:
|
|
[
|
|
"uvicorn", "app.main:create_app", "--factory",
|
|
"--host", "0.0.0.0", "--port", "8000",
|
|
"--reload", "--reload-dir", "/app/app"
|
|
]
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "python -c 'import urllib.request; urllib.request.urlopen(\"http://127.0.0.1:8000/api/health\", timeout=4)'"]
|
|
interval: 15s
|
|
timeout: 5s
|
|
start_period: 45s
|
|
retries: 5
|
|
networks:
|
|
- bangui-dev-net
|
|
|
|
# ── Frontend (Vite dev server with HMR) ─────────────────────
|
|
frontend:
|
|
image: node:22-alpine
|
|
container_name: bangui-frontend-dev
|
|
restart: unless-stopped
|
|
working_dir: /app
|
|
environment:
|
|
NODE_ENV: development
|
|
volumes:
|
|
- ../frontend:/app:z
|
|
- frontend-node-modules:/app/node_modules
|
|
ports:
|
|
- "${BANGUI_FRONTEND_PORT:-5173}:5173"
|
|
command: ["sh", "-c", "npm install && npm run dev -- --host 0.0.0.0"]
|
|
depends_on:
|
|
backend:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: ["CMD", "wget", "-qO", "/dev/null", "http://localhost:5173/"]
|
|
interval: 15s
|
|
timeout: 5s
|
|
start_period: 30s
|
|
retries: 5
|
|
networks:
|
|
- bangui-dev-net
|
|
|
|
volumes:
|
|
bangui-dev-data:
|
|
driver: local
|
|
frontend-node-modules:
|
|
driver: local
|
|
fail2ban-dev-config:
|
|
driver: local
|
|
fail2ban-dev-run:
|
|
driver: local
|
|
|
|
networks:
|
|
bangui-dev-net:
|
|
driver: bridge
|