Files
moyi-model-intelligence-hub/infra/moyi/docker-compose.yml
T

75 lines
2.0 KiB
YAML

name: moyi
services:
postgres:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER:-moyi}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD in infra/moyi/.env}
POSTGRES_DB: ${POSTGRES_DB:-moyi_control}
volumes:
- moyi_postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
interval: 10s
timeout: 5s
retries: 12
redis:
image: redis:7-alpine
restart: unless-stopped
command: ["redis-server", "--appendonly", "yes", "--requirepass", "${REDIS_PASSWORD:?Set REDIS_PASSWORD in infra/moyi/.env}"]
volumes:
- moyi_redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "-a", "$${REDIS_PASSWORD}", "ping"]
interval: 10s
timeout: 5s
retries: 12
moyi-api:
build:
context: ../../control-plane-java
restart: unless-stopped
env_file:
- path: .env
required: false
environment:
CONTROL_PLANE_HOST: 0.0.0.0
CONTROL_PLANE_PORT: 8787
SPRING_DATASOURCE_URL: jdbc:postgresql://postgres:5432/${POSTGRES_DB:-moyi_control}
SPRING_DATASOURCE_USERNAME: ${POSTGRES_USER:-moyi}
SPRING_DATASOURCE_PASSWORD: ${POSTGRES_PASSWORD}
SPRING_DATA_REDIS_URL: redis://:${REDIS_PASSWORD}@redis:6379/0
FLYWAY_ENABLED: true
MOYI_FORWARD_HEADERS_STRATEGY: native
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "wget -q -O - http://127.0.0.1:8787/health | grep -q 'status'"]
interval: 10s
timeout: 5s
retries: 12
start_period: 20s
frontend:
build:
context: ../../prototype
args:
VITE_CONTROL_PLANE_URL: /
VITE_AUTH_MODE: remote
restart: unless-stopped
ports:
- "${MOYI_HTTP_PORT:-8080}:80"
depends_on:
moyi-api:
condition: service_healthy
volumes:
moyi_postgres_data:
moyi_redis_data: