-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
80 lines (74 loc) · 1.61 KB
/
docker-compose.yaml
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
version: "3.8"
services:
server:
build:
context: server
dockerfile: ./Dockerfile
image: server:latest
command: python3 main.py
volumes:
- ./server:/opt/api
ports:
- "8000:8000"
stdin_open: true
tty: true
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [ gpu ]
client:
build:
context: client
dockerfile: ./Dockerfile
image: streamlit-client:latest
volumes:
- ./client:/opt/app
ports:
- "8501:8501"
stdin_open: true
tty: true
worker:
build:
context: server
dockerfile: ./Dockerfile
command: celery -A app.celery.celery_app worker --max-tasks-per-child=1 --loglevel=info -Q stable_diffusion
volumes:
- ./server:/opt/api
stdin_open: true
tty: true
depends_on:
server:
condition: service_started
redis:
condition: service_started
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: 1
capabilities: [ gpu ]
flower:
build: ./server
command: celery flower --basic_auth=admin:password
volumes:
- ./server:/opt/api
ports:
- "5555:5555"
environment:
- CELERY_BROKER_URL=redis://redis:6379/0
depends_on:
server:
condition: service_started
redis:
condition: service_started
redis:
image: redis:6-alpine
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
interval: 1s
timeout: 3s
retries: 30