Files
HarborForge.Test/docker-compose-frontend-expose.yml

110 lines
3.1 KiB
YAML

services:
mysql:
image: mysql:8.0
container_name: harborforge-test-mysql
restart: "no"
tmpfs:
- /var/lib/mysql
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}
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 10s
timeout: 5s
retries: 5
ports:
- "127.0.0.1:${MYSQL_PORT:-3306}:3306"
networks:
- test-network
wizard:
build:
context: ../AbstractWizard
dockerfile: Dockerfile
image: harborforge-test-wizard:dev
container_name: harborforge-test-wizard
user: 0:0
restart: "no"
volumes:
- wizard_config:/config
environment:
CONFIG_DIR: /config
LISTEN_ADDR: "0.0.0.0:${WIZARD_PORT:-8080}"
MAX_BACKUPS: "5"
# Allow frontend (container network) and localhost for testing
CORS_ORIGINS: http://frontend:${FRONTEND_PORT:-3000},http://127.0.0.1:${FRONTEND_PORT:-3000},http://localhost:${FRONTEND_PORT:-3000}
ports:
- "127.0.0.1:${WIZARD_PORT:-8080}:${WIZARD_PORT:-8080}"
networks:
- test-network
backend:
build:
context: ../HarborForge.Backend
dockerfile: Dockerfile
image: harborforge-test-backend:dev
container_name: harborforge-test-backend
restart: "no"
volumes:
- wizard_config:/config:ro
environment:
CONFIG_DIR: /config
CONFIG_FILE: harborforge.json
SECRET_KEY: ${SECRET_KEY:-change_me_in_production}
LOG_LEVEL: ${LOG_LEVEL:-INFO}
DATABASE_URL: mysql+pymysql://harborforge:harborforge_pass@mysql:${MYSQL_PORT:-3306}/harborforge
ports:
- "127.0.0.1:${BACKEND_PORT:-8000}:${BACKEND_PORT:-8000}"
depends_on:
mysql:
condition: service_healthy
networks:
- test-network
frontend:
build:
context: ../HarborForge.Frontend
dockerfile: Dockerfile
args:
VITE_WIZARD_PORT: ${WIZARD_PORT:-8080}
VITE_WIZARD_HOST: wizard
image: harborforge-test-frontend:dev
container_name: harborforge-test-frontend
restart: "no"
environment:
# Use internal service name for backend API
VITE_API_BASE_URL: http://backend:${BACKEND_PORT:-8000}
ports:
- "127.0.0.1:${FRONTEND_PORT:-3000}:${FRONTEND_PORT:-3000}"
depends_on:
- wizard
- backend
networks:
- test-network
test:
build:
context: ./HarborForge.Frontend.Test
dockerfile: Dockerfile
image: harborforge-test-runner:dev
container_name: harborforge-test-runner
restart: "no"
environment:
BASE_URL: http://localhost:${FRONTEND_PORT:-3000}
WEB_SERVER_URL: http://localhost:${FRONTEND_PORT:-3000}
WIZARD_URL: http://localhost:${WIZARD_PORT:-8080}/wizard
WIZARD_API_URL: http://localhost:${WIZARD_PORT:-8080}
CHROME_DEBUGGING_PORT: 9222
networks:
- test-network
volumes:
wizard_config:
networks:
test-network:
driver: bridge