-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
155 lines (146 loc) · 4.16 KB
/
docker-compose.yml
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
version: "3.8"
services:
iss-main-db:
container_name: iss-main-db
image: postgres:15.3-alpine
restart: always
environment:
POSTGRES_DB: ${DB_APP_DB_NAME:-app_db}
POSTGRES_HOST_AUTH_METHOD: ${DB_APP_AUTH_METHOD:-trust}
volumes:
- ./db:/var/lib/postgresql/data
networks:
- iss_network
iss-storage-db:
image: mongo:7.0.1-rc0
container_name: iss-storage-db
environment:
MONGO_INITDB_ROOT_USERNAME: ${DB_STORAGE_USER:-admin}
MONGO_INITDB_ROOT_PASSWORD: ${DB_STORAGE_PASSWORD:-password}
volumes:
- ./storage:/data/db
restart: always
networks:
- iss_network
iss-back:
container_name: iss-back
image: iss-back
build:
dockerfile: Dockerfile.backend
restart: always
environment:
DB_HOST: iss-main-db
DB_NAME: ${DB_APP_DB_NAME:-app_db}
SERVER_ORIGINS: ${SERVER_ORIGINS:-localhost}
SECRET_KEY: ${SECRET_KEY}
SECRET_ALGO: ${SECRET_ALGO}
MAX_WORKER: ${MAX_WORKER:-5}
BACKEND_PORT: ${BACKEND_PORT:-8000}
FRONTEND_PORT: ${FRONTEND_PORT:-3000}
depends_on:
- iss-main-db
command: >
sh -c "python manage.py makemigrations user &&
python manage.py makemigrations project &&
python manage.py makemigrations attribute &&
python manage.py makemigrations file &&
python manage.py migrate &&
python manage.py remove_tokens &&
gunicorn --config './conf/gunicorn_conf.py' proj_back.wsgi:application"
networks:
- iss_network
iss-storage:
container_name: iss-storage
image: iss-storage
build:
dockerfile: Dockerfile.storage
restart: always
environment:
DB_HOST: iss-storage-db
APP_BACKEND_URL: iss-back:${BACKEND_PORT:-8000}
DB_USER: ${DB_STORAGE_USER:-admin}
DB_PASSWORD: ${DB_STORAGE_PASSWORD:-password}
CELERY_BROKER_URL: ${BROKER_URL}
SECRET_KEY: ${SECRET_KEY}
SECRET_ALGO: ${SECRET_ALGO}
MAX_WORKER: ${MAX_WORKER:-5}
BACKEND_PORT: ${BACKEND_PORT:-8000}
FRONTEND_PORT: ${FRONTEND_PORT:-3000}
STORAGE_PORT: ${STORAGE_PORT:-9000}
depends_on:
- iss-storage-db
- iss-back
volumes:
- ./embedding_db:/app/embedding_db
command: python3 src/main.py
networks:
- iss_network
iss-front:
container_name: iss-front
image: iss_front
build:
dockerfile: Dockerfile.frontend
restart: always
depends_on:
- iss-back
environment:
BACKEND_PORT: ${BACKEND_PORT:-8000}
PORT: ${FRONTEND_PORT:-3000}
STORAGE_PORT: ${STORAGE_PORT:-9000}
ports:
- "${FRONTEND_PORT:-3000}:${FRONTEND_PORT:-3000}"
command: >
sh -c "REACT_APP_STORAGE_PORT=${STORAGE_PORT:-9000} REACT_APP_BACKEND_PORT=${BACKEND_PORT:-8000} npm run build && serve -s build"
networks:
- iss_network
iss-broker:
container_name: iss-broker
image: redis:alpine3.18
restart: always
volumes:
- ./broker-db:/data
- ./redis:/conf
command: redis-server /conf/redis.conf
networks:
- iss_network
iss-worker:
container_name: iss-worker
build:
dockerfile: Dockerfile.storage
restart: always
environment:
DB_HOST: iss-storage-db
APP_BACKEND_URL: iss-back:${BACKEND_PORT:-8000}
DB_USER: ${DB_STORAGE_USER:-admin}
DB_PASSWORD: ${DB_STORAGE_PASSWORD:-password}
CELERY_BROKER_URL: ${BROKER_URL}
SECRET_KEY: ${SECRET_KEY}
SECRET_ALGO: ${SECRET_ALGO}
STORAGE_PORT: ${STORAGE_PORT:-9000}
depends_on:
- iss-broker
- iss-back
volumes:
- ./embedding_db:/app/embedding_db
command: python3 src/worker.py
networks:
- iss_network
iss-proxy:
container_name: iss-proxy
image: nginx:1.25.1-alpine
restart: always
depends_on:
- iss-back
- iss-storage
environment:
BACKEND_PORT: ${BACKEND_PORT:-8000}
STORAGE_PORT: ${STORAGE_PORT:-9000}
ports:
- "${STORAGE_PORT:-9000}:${STORAGE_PORT:-9000}"
- "${BACKEND_PORT:-8000}:${BACKEND_PORT:-8000}"
volumes:
- ./nginx:/etc/nginx/templates
networks:
- iss_network
networks:
iss_network: