-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
154 lines (147 loc) · 4.02 KB
/
docker-compose.yml
File metadata and controls
154 lines (147 loc) · 4.02 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
# SPDX-FileCopyrightText: 2026 ArcheBase
#
# SPDX-License-Identifier: MulanPSL-2.0
# Docker Compose configuration for local development and CI.
#
# This file sets up the following services for roboflow development:
# - TiKV: Distributed KV storage for metadata/catalog
# - PD (Placement Driver): Cluster management for TiKV
# - MinIO: S3-compatible object storage for datasets
#
# Usage:
# docker compose up -d # Start all services
# docker compose down # Stop all services
# docker compose down -v # Stop and remove volumes
#
# Note: On macOS/Linux, add "127.0.0.1 host.docker.internal" to /etc/hosts for host connectivity
services:
# PD (Placement Driver) for TiKV cluster management
pd:
image: pingcap/pd:v8.5.5
container_name: roboflow-pd
extra_hosts:
- "host.docker.internal:host-gateway"
ports:
- "2379:2379" # PD client API
- "2380:2380" # PD peer API
command:
- --name=pd1
- --data-dir=/data
- --client-urls=http://0.0.0.0:2379
- --peer-urls=http://0.0.0.0:2380
- --advertise-client-urls=http://host.docker.internal:2379
- --advertise-peer-urls=http://pd:2380
- --initial-cluster=pd1=http://pd:2380
- --log-level=info
volumes:
- pd_data:/data
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:2379/health"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
networks:
- roboflow-network
# TiKV node for distributed KV storage
tikv:
image: pingcap/tikv:v8.5.5
container_name: roboflow-tikv
extra_hosts:
- "host.docker.internal:host-gateway"
ports:
- "20160:20160" # TiKV client API
- "20180:20180" # TiKV status API
command:
- --addr=0.0.0.0:20160
- --advertise-addr=host.docker.internal:20160
- --data-dir=/data
- --pd=http://pd:2379
- --log-level=info
- --status-addr=0.0.0.0:20180
volumes:
- tikv_data:/data
depends_on:
pd:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:20180/status"]
interval: 10s
timeout: 10s
retries: 15
start_period: 90s # TiKV can take 90s+ to bootstrap (PD join, store init)
networks:
- roboflow-network
ulimits:
nofile:
soft: 524288
hard: 524288
nproc:
soft: 65536
hard: 65536
deploy:
resources:
limits:
cpus: '2.0'
memory: 4G
reservations:
cpus: '1.0'
memory: 2G
# MinIO for S3-compatible object storage
minio:
image: minio/minio:latest
container_name: roboflow-minio
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
ports:
- "9000:9000" # S3 API
- "9001:9001" # Console
volumes:
- minio_data:/data
networks:
- roboflow-network
deploy:
resources:
limits:
cpus: '2.0'
memory: 2G
reservations:
cpus: '1.0'
memory: 1G
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
# MinIO client to create buckets
minio-init:
image: minio/mc:latest
container_name: roboflow-minio-init
restart: "no"
depends_on:
minio:
condition: service_started
entrypoint: >
/bin/sh -c "
sleep 5;
mc alias set myminio http://minio:9000 minioadmin minioadmin;
mc mb myminio/roboflow-datasets --ignore-existing;
mc mb myminio/roboflow-raw --ignore-existing;
mc mb myminio/roboflow-temp --ignore-existing;
mc anonymous set public myminio/roboflow-datasets;
mc anonymous set public myminio/roboflow-raw;
mc anonymous set public myminio/roboflow-temp;
exit 0;
"
networks:
- roboflow-network
volumes:
pd_data:
tikv_data:
minio_data:
networks:
roboflow-network:
driver: bridge