router-dashboard/docker-compose.yml

61 lines
1.5 KiB
YAML

version: '3.8'
services:
frontend:
build:
context: ./router-dashboard
dockerfile: Dockerfile
ports:
- "5173:5173"
environment:
- VITE_API_URL=http://localhost:3001/api/v1
depends_on:
- backend
volumes:
- ./router-dashboard:/app
- /app/node_modules
backend:
build:
context: ./ve-router-backend
dockerfile: Dockerfile
ports:
- "3001:3000"
environment:
- NODE_ENV=development
- DB_HOST=host.docker.internal
- DB_PORT=3307
- DB_USER=ve_router_user
- DB_PASSWORD=ve_router_password
- DB_NAME=ve_router_db
depends_on:
- mysql
volumes:
- ./ve-router-backend:/app
- /app/node_modules
mysql:
image: mysql:8.0
environment:
MYSQL_ROOT_PASSWORD: rootpassword
MYSQL_DATABASE: ve_router_db
MYSQL_USER: ve_router_user
MYSQL_PASSWORD: ve_router_password
volumes:
- mysql_data:/var/lib/mysql
# Correct paths for init scripts
- ./router-dashboard/sql/init.sql:/docker-entrypoint-initdb.d/01-init.sql
- ./router-dashboard/sql/seed_data.sql:/docker-entrypoint-initdb.d/02-seed_data.sql
ports:
- "3307:3306"
command: --default-authentication-plugin=mysql_native_password
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "ve_router_user", "-pve_router_password"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
volumes:
mysql_data: