-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
198 lines (188 loc) · 6.63 KB
/
Copy pathdocker-compose.dev.yml
File metadata and controls
198 lines (188 loc) · 6.63 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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
# Development stack: builds application images from this checkout and publishes all service ports.
# Start from repo root: `docker compose -f docker-compose.dev.yml up -d --build`.
# Alternative: `./scripts/docker-up-dev.sh <PUBLIC_URL>` sets CORS + runtime web configuration without a root `.env` (see DOCKER.md).
#
# Public hostname / HTTPS (not localhost): in root `.env` set PUBLIC_API_BASE_URL (API URL for the browser),
# ALLOWED_ORIGINS, OBJECT_STORAGE_ALLOWED_ORIGINS (UI origins), then recreate web/backend/object-storage.
# See DOCKER.md → "Custom URL or domain".
name: experiment-tracker
services:
postgres-backend:
image: postgres:16-alpine
environment:
POSTGRES_USER: ${POSTGRES_USER:-tracker}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-tracker}
POSTGRES_DB: ${POSTGRES_DB:-experiment_tracker}
ports:
- "${POSTGRES_BACKEND_PORT:-5435}:5432"
volumes:
- ./storage/postgres-backend:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U tracker -d experiment_tracker"]
interval: 5s
timeout: 5s
retries: 10
postgres-object-storage:
image: postgres:16-alpine
environment:
POSTGRES_USER: ${POSTGRES_OBJECT_STORAGE_USER:-tracker}
POSTGRES_PASSWORD: ${POSTGRES_OBJECT_STORAGE_PASSWORD:-tracker}
POSTGRES_DB: ${POSTGRES_OBJECT_STORAGE_DB:-object_storage}
ports:
- "${POSTGRES_OBJECT_STORAGE_PORT:-5434}:5432"
volumes:
- ./storage/postgres-object-storage:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U tracker -d object_storage"]
interval: 5s
timeout: 5s
retries: 10
redis:
image: redis:7-alpine
ports:
- "${REDIS_PORT:-6380}:6379"
volumes:
- ./storage/redis:/data
command: ["redis-server", "--appendonly", "yes"]
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 10
clickhouse:
image: clickhouse/clickhouse-server:24.8
environment:
CLICKHOUSE_USER: ${CLICKHOUSE_USER:-default}
CLICKHOUSE_PASSWORD: ${CLICKHOUSE_PASSWORD:-yourpass}
CLICKHOUSE_DB: ${CLICKHOUSE_DB:-default}
ports:
- "${CLICKHOUSE_HTTP_PORT:-8123}:8123"
ulimits:
nofile:
soft: 262144
hard: 262144
volumes:
- ./storage/clickhouse:/var/lib/clickhouse
healthcheck:
test:
[
"CMD-SHELL",
"wget -qO- http://localhost:8123/ping | grep -q Ok",
]
interval: 5s
timeout: 5s
retries: 15
start_period: 20s
minio:
image: minio/minio:latest
environment:
MINIO_ROOT_USER: ${MINIO_ROOT_USER:-admin}
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD:-password}
ports:
- "${MINIO_API_PORT:-9000}:9000"
- "${MINIO_CONSOLE_PORT:-9001}:9001"
volumes:
- ./storage/minio:/data
command: ["server", "/data", "--console-address", ":9001"]
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 5s
timeout: 5s
retries: 10
start_period: 10s
minio-init:
image: minio/mc:latest
depends_on:
minio:
condition: service_healthy
environment:
MINIO_ROOT_USER: ${MINIO_ROOT_USER:-admin}
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD:-password}
S3_BUCKET: ${S3_BUCKET:-ml-blobs}
entrypoint:
- /bin/sh
- -c
- |
mc alias set local http://minio:9000 "$$MINIO_ROOT_USER" "$$MINIO_ROOT_PASSWORD" \
&& mc mb "local/$$S3_BUCKET" --ignore-existing
object-storage:
build:
context: .
dockerfile: python/object_storage/Dockerfile
environment:
APP_NAME: ${OBJECT_STORAGE_APP_NAME:-ML Experiment Object Storage}
API_PREFIX: ${OBJECT_STORAGE_API_PREFIX:-/api}
# CORS: browser origins allowed to call object-storage (match your UI URL).
ALLOWED_ORIGINS: ${OBJECT_STORAGE_ALLOWED_ORIGINS:-http://localhost:3000,http://127.0.0.1:3000}
DATABASE_URL: ${OBJECT_STORAGE_DATABASE_URL:-postgresql+asyncpg://tracker:tracker@postgres-object-storage:5432/object_storage}
S3_ENDPOINT_URL: ${S3_ENDPOINT_URL:-http://minio:9000}
S3_REGION: ${S3_REGION:-us-east-1}
S3_ACCESS_KEY_ID: ${S3_ACCESS_KEY_ID:-admin}
S3_SECRET_ACCESS_KEY: ${S3_SECRET_ACCESS_KEY:-password}
S3_BUCKET: ${S3_BUCKET:-ml-blobs}
LOG_LEVEL: ${LOG_LEVEL:-INFO}
ports:
- "${OBJECT_STORAGE_PORT:-8002}:8002"
depends_on:
postgres-object-storage:
condition: service_healthy
minio:
condition: service_healthy
minio-init:
condition: service_completed_successfully
scalars:
build:
context: .
dockerfile: python/scalars_service/Dockerfile
environment:
CLICKHOUSE_URL: ${CLICKHOUSE_URL:-http://default:yourpass@clickhouse:8123/default}
REDIS_URL: ${REDIS_URL:-redis://redis:6379/0}
LOG_LEVEL: ${LOG_LEVEL:-INFO}
ports:
- "${SCALARS_PORT:-8001}:8001"
depends_on:
clickhouse:
condition: service_healthy
redis:
condition: service_healthy
backend:
build:
context: .
dockerfile: python/backend/Dockerfile
environment:
DATABASE_URL: ${DATABASE_URL:-postgresql+asyncpg://tracker:tracker@postgres-backend:5432/experiment_tracker}
JWT_SECRET: ${JWT_SECRET:-change-me-in-docker-env}
APP_NAME: ${APP_NAME:-Experiment Tracker}
API_PREFIX: ${API_PREFIX:-/api}
# Comma-separated browser origins for CORS (must include your real UI URL if not localhost).
ALLOWED_ORIGINS: ${ALLOWED_ORIGINS:-http://localhost:3000,http://127.0.0.1:3000}
SCALARS_SERVICE_URL: ${SCALARS_SERVICE_URL:-http://scalars:8001/api}
OBJECT_STORAGE_SERVICE_URL: ${OBJECT_STORAGE_SERVICE_URL:-http://object-storage:8002/api}
ADMIN_PANEL_KEY: ${ADMIN_PANEL_KEY:-admin}
LOG_LEVEL: ${LOG_LEVEL:-INFO}
ports:
- "${BACKEND_PORT:-8000}:8000"
depends_on:
postgres-backend:
condition: service_healthy
scalars:
condition: service_healthy
object-storage:
condition: service_healthy
web:
build:
context: .
dockerfile: apps/web/Dockerfile
environment:
NODE_ENV: production
PORT: "3000"
HOSTNAME: "0.0.0.0"
# Browser-reachable backend URL, injected into the frontend at container runtime.
PUBLIC_API_BASE_URL: ${PUBLIC_API_BASE_URL:-http://127.0.0.1:8000}
# Route Handlers must reach the API by Compose DNS, not 127.0.0.1 inside this container.
SERVER_API_BASE_URL: ${SERVER_API_BASE_URL:-http://backend:8000}
ports:
- "${WEB_PORT:-3000}:3000"
depends_on:
backend:
condition: service_healthy