-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.gpu.amd64.yml
More file actions
160 lines (151 loc) · 4.09 KB
/
docker-compose.gpu.amd64.yml
File metadata and controls
160 lines (151 loc) · 4.09 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
version: "3.8"
# AMD64 GPU-enabled local build configuration
# Use this on: x86_64 Linux servers with NVIDIA GPU
# Requirements: NVIDIA Docker runtime, CUDA-compatible GPU
# Usage: docker-compose -f docker-compose.gpu.amd64.yml up --build
services:
frontend:
build:
context: ./frontend
dockerfile: Dockerfile.local
ports:
- "8080:8080"
restart: unless-stopped
environment:
- TZ=Asia/Seoul
depends_on:
- backend
networks:
- app-network
backend:
build:
context: ./backend
dockerfile: Dockerfile.gpu
# Pass TARGETPLATFORM to Dockerfile ARG
args:
TARGETPLATFORM: linux/amd64
# Explicitly set platform for AMD64 builds (GPU support requires amd64)
platform: linux/amd64
environment:
- TZ=Asia/Seoul
- CONDA_DEFAULT_ENV=snakemake
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_HOST=db
- POSTGRES_PORT=5432
# Note: No CPU_ONLY flag - GPU enabled by default
ports:
- "8000:8000"
volumes:
- /var/run/docker.sock:/var/run/docker.sock
# Mount entire backend for consistency with celery service
- ./backend:/app
# Override official plugin directory as read-only
- ./backend/plugin/official:/app/plugin/official:ro
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
restart: unless-stopped
networks:
- app-network
db:
image: postgres:15
environment:
- TZ=Asia/Seoul
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
restart: unless-stopped
networks:
- app-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
ports:
- "6379:6379"
volumes:
- redis_data:/data
command: redis-server --maxmemory 512mb --maxmemory-policy allkeys-lru
restart: unless-stopped
networks:
- app-network
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
rabbitmq:
image: "rabbitmq:management"
environment:
- TZ=Asia/Seoul
- RABBITMQ_DEFAULT_USER=guest
- RABBITMQ_DEFAULT_PASS=guest
ports:
- "15672:15672"
- "5672:5672"
volumes:
- rabbitmq_data:/var/lib/rabbitmq
- ./rabbitmq.conf:/etc/rabbitmq/rabbitmq.conf
restart: unless-stopped
networks:
- app-network
celery:
build:
context: ./backend
dockerfile: Dockerfile.gpu.celery
# Pass TARGETPLATFORM to Dockerfile ARG
args:
TARGETPLATFORM: linux/amd64
# Explicitly set platform for AMD64 builds (GPU support requires amd64)
platform: linux/amd64
environment:
- CONDA_DEFAULT_ENV=snakemake
- C_FORCE_ROOT=true
- TZ=Asia/Seoul
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_HOST=db
- POSTGRES_PORT=5432
- GPU_COUNT=${GPU_COUNT:-0}
# Note: No CPU_ONLY flag - GPU enabled by default
volumes:
- /var/run/docker.sock:/var/run/docker.sock
# Mount entire backend for Docker-in-Docker compatibility
- ./backend:/app
# Override official plugin directory as read-only
- ./backend/plugin/official:/app/plugin/official:ro
depends_on:
rabbitmq:
condition: service_started
db:
condition: service_healthy
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: "${GPU_COUNT:-all}"
capabilities: [gpu]
restart: unless-stopped
networks:
- app-network
networks:
app-network:
driver: bridge
volumes:
postgres_data:
rabbitmq_data:
redis_data: