-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
230 lines (221 loc) · 5.83 KB
/
docker-compose.yml
File metadata and controls
230 lines (221 loc) · 5.83 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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
services:
web:
build:
context: frontend
dockerfile: Dockerfile
ports:
- "3000:3000"
restart: unless-stopped
env_file:
- frontend/.env
networks:
- bridge-network
# Serviço do Django (web)
django-api:
deploy:
resources:
limits:
cpus: "1"
memory: "0.6G"
user: ${DJANGO_API_UID}:${DATA_GID}
build:
context: backend
dockerfile: Dockerfile
args:
- USER=${DJANGO_API_USER}
- UID=${DJANGO_API_UID}
- GID=${DATA_GID}
restart: unless-stopped
environment:
- ENTRYPOINT_PATH=/src/scripts/docker-django-api-entrypoint.sh
volumes:
- ${DATA_ROOT_DIR}:${DATA_ROOT_DIR}:rw
- django-api-logs:/logs # Volume para logs
ports:
- "8000:8000"
env_file:
- .env
networks:
- bridge-network
depends_on:
- db
- rabbitmq
- redis
logging:
driver: "json-file" # Default logging driver
options:
max-size: "10m" # Limita o tamanho dos logs para 10MB
max-file: "3" # Mantém no máximo 3 arquivos de log
django-worker:
build:
context: backend
dockerfile: Dockerfile
args:
- USER=${DJANGO_WORKER_USER}
- UID=${DJANGO_WORKER_UID}
- GID=${DATA_GID}
restart: unless-stopped
user: ${DJANGO_WORKER_UID}:${DATA_GID}
deploy:
resources:
limits:
cpus: "2"
memory: "4G"
volumes:
- ${DATA_ROOT_DIR}:${DATA_ROOT_DIR}:rw
env_file:
- .env
environment:
- CELERY_BROKER_URL=${CELERY_BROKER_URL}
- ENTRYPOINT_PATH=/src/scripts/docker-django-worker-entrypoint.sh
networks:
- bridge-network
depends_on:
- rabbitmq
logging:
driver: "json-file" # Default logging driver
options:
max-size: "10m" # Limita o tamanho dos logs para 10MB
max-file: "3" # Mantém no máximo 3 arquivos de log
# Serviço Celery Worker para PDF (com acesso ao Django e ao pdf_processor)
pdf2chemicals-worker:
build:
context: backend
dockerfile: Dockerfile
args:
- USER=${PDF2CHEMICALS_WORKER_USER}
- UID=${PDF2CHEMICALS_WORKER_UID}
- GID=${DATA_GID}
restart: unless-stopped
hostname: ${PDF2CHEMICALS_WORKER_HOSTNAME}
deploy:
resources:
limits:
cpus: "2"
memory: "4G"
networks:
bridge-network:
ipv4_address: ${PDF2CHEMICALS_WORKER_HOSTNAME_IPV4}
extra_hosts:
- ${TORQUE_SERVER}:${TORQUE_SERVER_HOST}
volumes:
- ${DATA_ROOT_DIR}:${DATA_ROOT_DIR}:rw
- ${HOST_USER_LIST}:${HOST_USER_LIST}:ro
- ${HOST_USER_PASSWORD_LIST}:${HOST_USER_PASSWORD_LIST}:ro
- ${HOST_GROUP_LIST}:${HOST_GROUP_LIST}:ro
- ${TORQUE_HOME}:${TORQUE_HOME}:ro
- ${TORQUE_USER_HOME}:${TORQUE_USER_HOME}
- ${TORQUE_ROOT_DIR}/server_name:${TORQUE_ROOT_DIR}/server_name:ro
- ${TORQUE_ROOT_DIR}/server_priv/accounting:${TORQUE_ROOT_DIR}/server_priv/accounting:ro
- ${TORQUE_ROOT_DIR}/server_logs:${TORQUE_ROOT_DIR}/server_logs:ro
- ${TORQUE_ROOT_DIR}/mom_logs:${TORQUE_ROOT_DIR}/mom_logs:ro
env_file:
- .env
environment:
- ENTRYPOINT_PATH=/src/scripts/docker-pdf2chemicals-worker-entrypoint.sh
- TORQUE_HOME=${TORQUE_HOME}
- TORQUE_SERVER=${TORQUE_SERVER}
- CELERY_BROKER_URL=${CELERY_BROKER_URL}
- PATH=${TORQUE_HOME}/bin:${TORQUE_HOME}/sbin:$PATH
- LD_LIBRARY_PATH=${TORQUE_HOME}/lib:$LD_LIBRARY_PATH
depends_on:
- rabbitmq
logging:
driver: "json-file" # Default logging driver
options:
max-size: "10m" # Limita o tamanho dos logs para 10MB
max-file: "3" # Mantém no máximo 3 arquivos de log
db:
build:
context: backend/db
dockerfile: Dockerfile
deploy:
resources:
limits:
cpus: "1"
memory: "2G"
networks:
- bridge-network
environment:
POSTGRES_PASSWORD: ${DATABASE_PASSWORD}
POSTGRES_USER: ${DATABASE_USER}
POSTGRES_DB: ${DATABASE_NAME}
env_file:
- .env
command: >
postgres -c port=5477
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5477:5477"
restart: unless-stopped
redis:
image: redis:7.2-alpine
deploy:
resources:
limits:
cpus: "1"
memory: "2G"
networks:
- bridge-network
command: >
redis-server --appendonly yes --requirepass "$REDIS_PASSWORD"
volumes:
- redis-data:/data
ports:
- "6379:6379"
env_file:
- .env
environment:
REDIS_PASSWORD: "${REDIS_PASSWORD}"
restart: unless-stopped
# Serviço RabbitMQ (broker de mensagens)
rabbitmq:
hostname: rabbitmq
image: rabbitmq:4-management-alpine
deploy:
resources:
limits:
cpus: "1"
memory: "1G"
networks:
- bridge-network
environment:
RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS: "-rabbit consumer_timeout 31622400000"
ports:
- "5672:5672" # Porta padrão do RabbitMQ
- "15672:15672" # Porta para a interface de administração do RabbitMQ
restart: unless-stopped
volumes:
- rabbitmq_data:/var/lib/rabbitmq
clam-container:
container_name: clam-container-01
image: clamav/clamav:stable_base
deploy:
resources:
limits:
cpus: "0.5"
memory: "3G"
networks:
- bridge-network
ports:
- "3310:3310"
- "7357:7357"
volumes:
- clamav-data:/var/lib/clamav
- clamav-logs:/var/log/clamav
restart: unless-stopped
networks:
bridge-network:
driver: bridge
ipam:
config:
- subnet: ${LABSOA_WEBSITE_SUBNET}
volumes:
redis-data:
media:
clamav-data:
clamav-logs:
django-api-logs: # Volume dedicado para logs do Django
postgres_data:
rabbitmq_data: