Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
141 lines (135 loc) · 4.54 KB
/
Copy pathdocker-compose.yml
File metadata and controls
141 lines (135 loc) · 4.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
services:
# Shared compose for local + staging.
# Host ports: POSTGRES_HOST_PORT (core-api .env), MINIO_*_HOST_PORT (ai-core .env).
# Compose substitutes from project-root `.env` OR:
# docker compose --env-file apps/core-api/.env --env-file services/ai-core-services/.env up -d
# Staging MinIO public URL: MINIO_SERVER_URL in services/ai-core-services/.env
# Model weights host path: AI_MODELS_HOST_DIR (default ./data/ai-models;
# staging: /www/ezscreen-models) — set in services/ai-core-services/.env
db:
image: postgres:15-alpine
container_name: ezscreen-db
restart: always
env_file:
- ./apps/core-api/.env
ports:
- "${POSTGRES_HOST_PORT:-5434}:5432"
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U \"$$POSTGRES_USER\" -d \"$$POSTGRES_DB\""]
interval: 5s
timeout: 5s
retries: 5
minio:
image: minio/minio:latest
container_name: ezscreen-minio
restart: always
env_file:
- ./services/ai-core-services/.env
ports:
- "${MINIO_API_HOST_PORT:-9002}:9000"
- "${MINIO_CONSOLE_HOST_PORT:-9003}:9001"
environment:
MINIO_API_CORS_ALLOW_ORIGIN: "*"
volumes:
- miniodata:/data
command: server /data --console-address ":9001"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 5s
timeout: 5s
retries: 5
minio-init:
image: minio/mc:latest
container_name: ezscreen-minio-init
depends_on:
minio:
condition: service_healthy
env_file:
- ./services/ai-core-services/.env
entrypoint: >
/bin/sh -c "
/usr/bin/mc alias set local http://minio:9000 $$MINIO_ROOT_USER $$MINIO_ROOT_PASSWORD;
/usr/bin/mc mb --ignore-existing local/resumes;
/usr/bin/mc mb --ignore-existing local/jds;
/usr/bin/mc mb --ignore-existing local/attendee-recordings;
exit 0;
"
core-api:
build:
context: ./apps/core-api
dockerfile: Dockerfile
container_name: ezscreen-core-api
restart: always
ports:
- "8000:8000"
env_file:
- ./apps/core-api/.env
extra_hosts:
- "host.docker.internal:host-gateway"
environment:
# Docker DNS — do not set MINIO_ENDPOINT here (presigned URLs go to the browser)
AI_SERVICES_HOST: ai-core-services
MINIO_INTERNAL_ENDPOINT: minio:9000
depends_on:
db:
condition: service_healthy
minio:
condition: service_healthy
ai-core-services:
build:
context: ./services/ai-core-services
dockerfile: Dockerfile
container_name: ezscreen-ai-core-services
restart: always
ports:
- "8002:8002"
env_file:
- ./services/ai-core-services/.env
extra_hosts:
- "host.docker.internal:host-gateway"
environment:
CORE_API_URL: "http://core-api:8000"
CORE_API_BASE_URL: "http://core-api:8000"
# The host model directory is mounted below; use the container path here.
KOKORO_MODEL_PATH: /app/.models/kokoro-v1.0.onnx
KOKORO_VOICES_PATH: /app/.models/voices-v1.0.bin
# Fetch the Kokoro files into the mounted model dir on first startup if
# they are missing; without them the screening bot cannot speak (Bug-043).
KOKORO_ALLOW_DOWNLOAD: "true"
# Keep HF downloads on the host bind mount (not ephemeral container FS).
HF_HOME: /root/.cache/huggingface
TRANSFORMERS_CACHE: /root/.cache/huggingface
HUGGINGFACE_HUB_CACHE: /root/.cache/huggingface
volumes:
# Models on the EC2 host (default: ./data/ai-models). Staging: set
# AI_MODELS_HOST_DIR=/www/ezscreen-models so weights live on the large disk,
# not under /var/lib/docker on the small root volume.
- ${AI_MODELS_HOST_DIR:-./data/ai-models}/rapidocr:/usr/local/lib/python3.11/site-packages/rapidocr/models
- ${AI_MODELS_HOST_DIR:-./data/ai-models}/huggingface:/root/.cache/huggingface
- ${AI_MODELS_HOST_DIR:-./data/ai-models}/kokoro:/app/.models
depends_on:
db:
condition: service_healthy
minio:
condition: service_healthy
frontend:
build:
context: ./apps/frontend
dockerfile: Dockerfile
container_name: ezscreen-frontend
restart: always
ports:
- "5173:5173"
env_file:
- ./apps/frontend/.env
environment:
# Vite proxy runs inside this container — use Docker DNS, not localhost
DEV_API_PROXY_TARGET: http://core-api:8000
depends_on:
- core-api
- ai-core-services
volumes:
pgdata:
miniodata: