-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
116 lines (110 loc) · 2.64 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
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
version: "3"
services:
# Flask Backend Service
backend:
build:
context: ./backend
dockerfile: Dockerfile-flask
container_name: backend
command: python run.py
# command: gunicorn -w 4 -b 0.0.0.0:5000 run:app
environment:
- REDIS_URL=redis://redis
- REDIS_PORT=6379
- RESOURCE_PATH=/segtracker/resources
- DATABASE_URL=postgresql://segtracker:password@postgres:5432/segtracker
- RQ_DASHBOARD_USERNAME=admin
- RQ_DASHBOARD_PASSWORD=admin
volumes:
- ./resources:/segtracker/resources
- ./backend:/backend # for debugging
networks:
- segtracker-network
depends_on:
- redis
- postgres
# RQ Worker Service
worker:
build:
context: ./backend
dockerfile: Dockerfile-worker
shm_size: "8gb"
container_name: worker
command: rq worker
environment:
- REDIS_URL=redis://redis
- REDIS_PORT=6379
- RESOURCE_PATH=/segtracker/resources
- DATABASE_URL=postgresql://segtracker:password@postgres:5432/segtracker
volumes:
- ./resources:/segtracker/resources
- ./backend:/backend
networks:
- segtracker-network
depends_on:
- redis
- postgres
deploy:
resources:
reservations:
devices:
- driver: "nvidia"
device_ids: ["0"]
capabilities: [gpu]
# React Frontend Service
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
args:
- VITE_APP_API_URL=/api
container_name: frontend
ports:
- "80:80"
networks:
- segtracker-network
volumes:
- ./resources:/segtracker/resources
depends_on:
- backend
# React Frontend Service for Dev
# frontend-dev:
# build:
# context: ./frontend
# dockerfile: Dockerfile-dev
# args:
# - VITE_APP_API_URL=http://localhost/api
# container_name: frontend-dev
# ports:
# - "5173:5173"
# volumes:
# - ./frontend/src:/app/src
# - ./frontend/public:/app/public
# networks:
# - segtracker-network
# depends_on:
# - backend
# Redis Service
redis:
image: redis:alpine
container_name: redis
networks:
- segtracker-network
volumes:
- ./redis-data:/data
postgres:
image: postgres:latest
container_name: postgres
environment:
POSTGRES_USER: segtracker
POSTGRES_PASSWORD: password
POSTGRES_DB: segtracker
ports:
- "127.0.0.1:54320:5432"
networks:
- segtracker-network
volumes:
- ./postgres-data:/var/lib/postgresql/data
networks:
segtracker-network:
driver: bridge