-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
186 lines (177 loc) · 4.69 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
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
services:
# Serviço do Django (web)
django-api:
deploy:
resources:
limits:
cpus: "1"
memory: "1G"
build:
context: .
dockerfile: Dockerfile
restart: unless-stopped
volumes:
- ${DATA_ROOT_DIR}:${DATA_ROOT_DIR}
- ./django-api-logs:/logs
ports:
- "8000:8000"
env_file:
- .env
networks:
- bridge-network
depends_on:
- db
- rabbitmq
- redis
django-worker:
build:
context: . # Usar o Dockerfile do pdf2chemicals
dockerfile: Dockerfile_Worker
restart: unless-stopped
deploy:
resources:
limits:
cpus: "2"
memory: "4G"
entrypoint: /src/docker-django-worker-entrypoint.sh
volumes:
- ${DATA_ROOT_DIR}:${DATA_ROOT_DIR}
environment:
- CELERY_BROKER_URL=${CELERY_BROKER_URL}
networks:
- bridge-network
depends_on:
- rabbitmq
logging:
driver: "json-file" # Default logging driver
options:
max-size: "10m" # Rotate logs after they reach 10 MB
max-file: "3" # Keep a maximum of 3 log files
# Serviço Celery Worker para PDF (com acesso ao Django e ao pdf_processor)
pdf2chemicals-worker:
build:
context: . # Usar o Dockerfile do pdf2chemicals
dockerfile: Dockerfile_Worker
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}
entrypoint: /src/docker-pdf2chemicals-worker-entrypoint.sh
volumes:
- ${DATA_ROOT_DIR}:${DATA_ROOT_DIR}
- ${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
environment:
- 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" # Rotate logs after they reach 10 MB
max-file: "3" # Keep a maximum of 3 log files
db:
build:
context: ./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}
command: >
postgres -c port=5477
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5477:5477"
restart: unless-stopped
redis:
image: redis:7.2.4-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"
environment:
REDIS_PASSWORD: "${REDIS_PASSWORD}"
restart: unless-stopped
# Serviço RabbitMQ (broker de mensagens)
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
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:
postgres_data: