-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
191 lines (182 loc) · 4.37 KB
/
Copy pathdocker-compose.yml
File metadata and controls
191 lines (182 loc) · 4.37 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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
services:
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: backend
restart: unless-stopped
logging:
driver: 'json-file'
options:
max-size: '10m'
max-file: '3'
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
minio:
condition: service_healthy
migrations:
condition: service_completed_successfully
env_file:
- backend/.env
environment:
- DATABASE_URL=postgres://postgres:1234@db:5432/bankiq
ports:
- '8000:8000'
networks:
- bankIQ
migrations:
build:
context: ./backend
container_name: migrations
command: [
'/bin/sh',
'-c',
'python -c "from core.one_time_tasks import clear_database; clear_database()" &&
python manage.py migrate &&
python manage.py init_formtypes &&
python manage.py init_admin_user' ]
environment:
- DATABASE_URL=postgres://postgres:1234@db:5432/bankiq
networks:
- bankIQ
depends_on:
db:
condition: service_healthy
minio:
condition: service_healthy
restart: no
db:
image: postgres:14
container_name: postgres
restart: unless-stopped
env_file:
- backend/.env
environment:
- POSTGRES_USER=${POSTGRES_USER:-postgres}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-1234}
- POSTGRES_DB=${POSTGRES_DB:-bankiq}
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U $${POSTGRES_USER} " ]
interval: 10s
timeout: 5s
retries: 3
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
ports:
- "5432:5432"
volumes:
- pg_data:/var/lib/postgresql/data
networks:
- bankIQ
redis:
image: redis:7
container_name: redis
restart: unless-stopped
ports:
- "6379:6379"
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: 3
networks:
- bankIQ
celery_worker:
build:
context: ./backend
dockerfile: Dockerfile
container_name: celery_worker
command: [ "celery", "-A", "bank_iq", "worker", "-l", "info" ]
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
env_file:
- backend/.env
environment:
- DATABASE_URL=postgres://postgres:1234@db:5432/bankiq
- CELERY_BROKER_URL=redis://redis:6379/0
- CELERY_RESULT_BACKEND=redis://redis:6379/0
networks:
- bankIQ
celery_beat:
build:
context: ./backend
dockerfile: Dockerfile
container_name: celery_beat
command: [ "celery", "-A", "bank_iq", "beat", "-l", "info" ]
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
env_file:
- backend/.env
environment:
- DATABASE_URL=postgres://postgres:1234@db:5432/bankiq
- CELERY_BROKER_URL=redis://redis:6379/0
- CELERY_RESULT_BACKEND=redis://redis:6379/0
networks:
- bankIQ
minio:
image: quay.io/minio/minio:latest
container_name: minio
restart: unless-stopped
ports:
- "9000:9000"
- "9001:9001"
env_file:
- backend/.env
environment:
- MINIO_ROOT_USER=${MINIO_ACCESS_KEY:-minio-access-key}
- MINIO_ROOT_PASSWORD=${MINIO_SECRET_KEY:-minio-secret-key}
volumes:
- minio_data:/data
command: server /data --console-address ":9001"
healthcheck:
test: [ "CMD-SHELL", "curl -fsS http://127.0.0.1:9000/minio/health/ready || exit 1" ]
interval: 5s
timeout: 3s
retries: 3
start_period: 5s
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
networks:
- bankIQ
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
target: development
container_name: frontend
restart: unless-stopped
ports:
- '5173:5173'
environment:
- VITE_API_URL=http://backend:8000
volumes:
- ./frontend:/app
- frontend_node_modules:/app/node_modules
command: [ "/bin/sh", "-c", "npm install && npm run dev -- --host 0.0.0.0" ]
depends_on:
- backend
networks:
- bankIQ
volumes:
db_data:
frontend_node_modules:
pg_data:
minio_data:
networks:
bankIQ:
driver: bridge