Files
HarborForge/docker-compose.yml

107 lines
2.5 KiB
YAML

services:
mysql:
image: mysql:8.0
container_name: harborforge-mysql
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-harborforge_root}
MYSQL_DATABASE: ${MYSQL_DATABASE:-harborforge}
MYSQL_USER: ${MYSQL_USER:-harborforge}
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-harborforge_pass}
volumes:
- mysql_data:/var/lib/mysql
ports:
- "127.0.0.1:${MYSQL_PORT:-3306}:3306"
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 10s
timeout: 5s
retries: 5
deploy:
resources:
limits:
cpus: '0.5'
memory: 512M
wizard:
build:
context: ./AbstractWizard
dockerfile: Dockerfile
image: harborforge-wizard:dev
container_name: harborforge-wizard
user: 0:0
restart: unless-stopped
volumes:
- wizard_config:/config
environment:
CONFIG_DIR: /config
LISTEN_ADDR: "0.0.0.0:8080"
MAX_BACKUPS: "5"
CORS_ORIGINS: http://127.0.0.1:3000,http://localhost:3000
ports:
- "127.0.0.1:${WIZARD_PORT:-18080}:8080"
deploy:
resources:
limits:
cpus: '0.1'
memory: 64M
backend:
build:
context: ./HarborForge.Backend
dockerfile: Dockerfile
container_name: harborforge-backend
restart: unless-stopped
environment:
CONFIG_DIR: /config
CONFIG_FILE: harborforge.json
SECRET_KEY: ${SECRET_KEY:-change_me_in_production}
LOG_LEVEL: ${LOG_LEVEL:-INFO}
volumes:
- wizard_config:/config:ro
ports:
- "127.0.0.1:${BACKEND_PORT:-8000}:8000"
depends_on:
mysql:
condition: service_healthy
deploy:
resources:
limits:
cpus: '0.5'
memory: 512M
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
frontend:
build:
context: ./HarborForge.Frontend
dockerfile: Dockerfile
args:
VITE_WIZARD_PORT: ${WIZARD_PORT:-18080}
container_name: harborforge-frontend
restart: unless-stopped
ports:
- "127.0.0.1:${FRONTEND_PORT:-3000}:3000"
depends_on:
- wizard
deploy:
resources:
limits:
cpus: '0.25'
memory: 128M
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://localhost:3000"]
interval: 30s
timeout: 10s
retries: 3
volumes:
mysql_data:
driver: local
wizard_config:
driver: local