forked from aron-muon/KubeCodeRun
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
84 lines (80 loc) · 2.49 KB
/
docker-compose.yml
File metadata and controls
84 lines (80 loc) · 2.49 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
# Infrastructure services for local development
#
# Usage:
# 1. Start infrastructure: docker compose up -d
# 2. Start a local Kubernetes cluster (minikube, kind, etc.)
# 3. Deploy the API to Kubernetes or run locally with KUBECONFIG set
#
# The API requires Kubernetes for code execution - it cannot run via Docker Compose.
services:
# Redis for session management and state persistence
redis:
image: redis:7-alpine
container_name: kubecoderun-redis
ports:
- "127.0.0.1:6379:6379"
environment:
- REDIS_PASSWORD=${REDIS_PASSWORD:-}
command: >
sh -c "
if [ -n \"$$REDIS_PASSWORD\" ]; then
redis-server --requirepass $$REDIS_PASSWORD --appendonly yes --appendfsync everysec
else
redis-server --appendonly yes --appendfsync everysec
fi
"
volumes:
- redis-data:/data
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 30s
timeout: 10s
retries: 3
# MinIO for file storage
minio:
image: minio/minio:latest
container_name: kubecoderun-minio
ports:
- "127.0.0.1:9000:9000"
- "127.0.0.1:${MINIO_CONSOLE_PORT:-9001}:9001"
environment:
- MINIO_ROOT_USER=${MINIO_ACCESS_KEY:-minioadmin}
- MINIO_ROOT_PASSWORD=${MINIO_SECRET_KEY:-minioadmin}
- MINIO_BROWSER_REDIRECT_URL=http://localhost:9001
command: server /data --console-address ":9001"
volumes:
- minio-data:/data
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 10s
retries: 3
# MinIO bucket initialization
minio-init:
image: minio/mc:latest
container_name: kubecoderun-minio-init
depends_on:
- minio
environment:
- MINIO_ENDPOINT=minio:9000
- MINIO_ACCESS_KEY=${MINIO_ACCESS_KEY:-minioadmin}
- MINIO_SECRET_KEY=${MINIO_SECRET_KEY:-minioadmin}
- MINIO_BUCKET=${MINIO_BUCKET:-kubecoderun-files}
entrypoint: >
/bin/sh -c "
echo 'Waiting for MinIO to be ready...';
until mc alias set minio http://$$MINIO_ENDPOINT $$MINIO_ACCESS_KEY $$MINIO_SECRET_KEY; do
echo 'MinIO not ready, waiting...';
sleep 2;
done;
echo 'MinIO is ready. Creating bucket if it does not exist...';
mc mb minio/$$MINIO_BUCKET --ignore-existing;
echo 'Bucket setup complete.';
"
volumes:
redis-data:
driver: local
minio-data:
driver: local