-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
210 lines (200 loc) · 5.99 KB
/
Copy pathdocker-compose.dev.yml
File metadata and controls
210 lines (200 loc) · 5.99 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
199
200
201
202
203
204
205
206
207
208
209
210
services:
# Backend (Spring Boot)
backend:
build:
context: ./backend
dockerfile: Dockerfile.dev
container_name: rayflow_backend_dev
ports:
- "3000:3000"
volumes:
- ./backend:/app
- m2:/root/.m2
- ${RAYFLOW_KUBECONFIG_DIR:-${HOME}/.kube}:/root/.kube:ro
environment:
RAYFLOW_WORKER_URL: http://worker:8090
env_file:
- backend/.env
healthcheck:
test: ["CMD-SHELL", "wget -q -O - http://localhost:3000/api/health >/dev/null || exit 1"]
interval: 10s
timeout: 5s
retries: 10
start_period: 30s
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
flink:
condition: service_started
rustfs-init:
condition: service_completed_successfully
worker:
condition: service_healthy
# ── Image Build Worker (Docker-in-Docker) ──────────────────────────────
# 其他服务不挂载宿主 docker.sock;只有 worker 特权运行 dockerd
worker:
build:
context: ./worker
dockerfile: Dockerfile
container_name: rayflow_worker_dev
privileged: true
environment:
- DOCKER_TLS_CERTDIR=
- WORKER_PORT=8090
ports:
- "8090:8090"
volumes:
- worker_docker_data:/var/lib/docker
healthcheck:
test: ["CMD-SHELL", "wget -q -O - http://localhost:8090/api/health > /dev/null || exit 1"]
interval: 15s
timeout: 5s
retries: 10
start_period: 30s
# Admin Frontend (Next.js)
admin:
build:
context: ./frontend/admin
dockerfile: Dockerfile.dev
container_name: rayflow_admin_dev
command: sh -c "pnpm config set registry https://registry.npmmirror.com && pnpm install && pnpm dev"
volumes:
- ./frontend/admin:/app
- /app/node_modules
environment:
- CI=true
- NEXT_PUBLIC_API_BASE_URL=
- NEXT_PUBLIC_APP_VERSION=0.0.5
- RAYFLOW_API_PROXY_TARGET=http://backend:3000
depends_on:
backend:
condition: service_started
# Nginx reverse proxy
nginx:
image: nginx:alpine
container_name: rayflow_nginx_dev
ports:
- "8080:80"
volumes:
- ./deploy/nginx/default.conf:/etc/nginx/conf.d/default.conf
depends_on:
- backend
- admin
# Docs Site (VitePress)
docs:
build:
context: ./frontend/docs
dockerfile: Dockerfile.dev
container_name: rayflow_docs_dev
restart: unless-stopped
ports:
- "8003:8003"
volumes:
- ./frontend/docs:/app
- /app/node_modules
# PostgreSQL
postgres:
image: postgres:16-alpine
container_name: rayflow_postgres_dev
environment:
POSTGRES_DB: rayflow
POSTGRES_USER: rayflow
POSTGRES_PASSWORD: rayflow123
command: ["postgres", "-c", "timezone=UTC"]
ports:
- "5433:5432"
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U rayflow"]
interval: 5s
timeout: 3s
retries: 10
# Redis
redis:
image: redis:7-alpine
container_name: rayflow_redis_dev
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 10
# RustFS: S3-compatible object storage for local artifacts.
# S3 API: http://localhost:9010, console: http://localhost:9011
rustfs:
image: rustfs/rustfs:1.0.0-beta.8
container_name: rayflow_rustfs_dev
restart: unless-stopped
ports:
- "9010:9000"
- "9011:9001"
environment:
RUSTFS_ACCESS_KEY: ${RAYFLOW_ARTIFACT_S3_ACCESS_KEY:-rustfsadmin}
RUSTFS_SECRET_KEY: ${RAYFLOW_ARTIFACT_S3_SECRET_KEY:-rustfsadmin}
RUSTFS_CONSOLE_ENABLE: "true"
TZ: ${RAYFLOW_TIMEZONE:-Asia/Shanghai}
volumes:
- rustfs_data:/data
rustfs-init:
image: minio/mc:RELEASE.2025-05-21T01-59-54Z
container_name: rayflow_rustfs_init_dev
depends_on:
rustfs:
condition: service_started
entrypoint: >
/bin/sh -c "
until mc alias set rayflow http://rustfs:9000 ${RAYFLOW_ARTIFACT_S3_ACCESS_KEY:-rustfsadmin} ${RAYFLOW_ARTIFACT_S3_SECRET_KEY:-rustfsadmin}; do sleep 2; done &&
mc mb --ignore-existing rayflow/${RAYFLOW_ARTIFACT_S3_BUCKET:-rayflow-artifacts} &&
mc mb --ignore-existing rayflow/${RAYFLOW_LAKE_S3_BUCKET:-rayflow-lake}
"
# Flink all-in-one: JobManager + TaskManager + SQL Gateway
flink:
image: ${FLINK_IMAGE:-flink:2.2.1}
container_name: rayflow_flink_dev
ports:
- "8081:8081"
- "8083:8083"
volumes:
- ${FLINK_LIB_DIR:-./deploy/docker/flink/custom-lib}:/opt/rayflow/flink-lib:ro
command:
- "bash"
- "-c"
- |
find /opt/rayflow/flink-lib -type f -name '*.jar' -exec cp {} /opt/flink/lib/ \; &&
mkdir -p /opt/flink/plugins/s3-fs-hadoop &&
cp /opt/flink/opt/flink-s3-fs-hadoop-*.jar /opt/flink/plugins/s3-fs-hadoop/ 2>/dev/null || true &&
/opt/flink/bin/jobmanager.sh start-foreground &
/opt/flink/bin/taskmanager.sh start-foreground &
/opt/flink/bin/sql-gateway.sh start-foreground &
wait -n
environment:
- |
FLINK_PROPERTIES=
jobmanager.rpc.address: flink-jobmanager
rest.address: flink-jobmanager
rest.port: 8081
taskmanager.numberOfTaskSlots: 4
sql-gateway.endpoint.rest.address: 0.0.0.0
sql-gateway.endpoint.rest.port: 8083
s3.endpoint: ${RAYFLOW_ARTIFACT_S3_ENDPOINT:-http://rustfs:9000}
s3.access-key: ${RAYFLOW_ARTIFACT_S3_ACCESS_KEY:-rustfsadmin}
s3.secret-key: ${RAYFLOW_ARTIFACT_S3_SECRET_KEY:-rustfsadmin}
s3.path.style.access: true
s3.region: ${RAYFLOW_ARTIFACT_S3_REGION:-us-east-1}
networks:
default:
aliases:
- flink-jobmanager
- flink-sql-gateway
depends_on:
rustfs-init:
condition: service_completed_successfully
volumes:
pgdata:
m2:
rustfs_data:
worker_docker_data: