-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-prod.yml
executable file
·231 lines (218 loc) · 5.2 KB
/
docker-compose-prod.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
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
231
version: "3.8"
secrets:
recaptcha_secret:
file: "./secrets/recaptcha_secret.secret"
geolocation_api_key:
file: "./secrets/geolocation_api_key.secret"
openai_api_key:
file: "./secrets/openai_api_key.secret"
fb_account_email:
file: "./secrets/fb_account_email.secret"
fb_account_password:
file: "./secrets/fb_account_password.secret"
mongodb_uri:
file: "./secrets/mongodb_uri.secret"
mail_username:
file: "./secrets/mail_username.secret"
mail_password:
file: "./secrets/mail_password.secret"
services:
parser:
build:
context: ./parser
dockerfile: Dockerfile.prod
secrets:
- openai_api_key
restart: unless-stopped
volumes:
- ./parser:/usr/src/app
environment:
- NODE_ENV=production
- PORT=3000
- MAIN_PROMPT_PATH=./prompt1.txt
- DESCRIPTION_PROMPT_PATH=./prompt2.txt
- DEBUG_START_EXPRESS_SERVER=true
- PING_SERVER_PORT=3434
networks:
- db-api-network
depends_on:
db-api:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "wget -q -O- http://localhost:3434/ping || exit 1"]
interval: 5s
timeout: 5s
retries: 3
start_period: 5s
webapp:
build:
context: ./webapp
dockerfile: Dockerfile.prod
restart: unless-stopped
environment:
- NODE_ENV=production
ports:
- "8080:80" # servizio pubblico
depends_on:
db-api:
condition: service_healthy
networks:
- public-network
fb-scraper:
build:
context: ./fb-scraper
dockerfile: Dockerfile.prod
restart: on-failure:5
secrets:
- fb_account_email
- fb_account_password
environment:
- NODE_ENV=production
- PING_SERVER_PORT=3434
depends_on:
db-api:
condition: service_healthy
parser:
condition: service_healthy
networks:
- db-api-network
healthcheck:
test: ["CMD-SHELL", "wget -q -O- http://localhost:3434/ping || exit 1"]
interval: 5s
timeout: 5s
retries: 3
start_period: 5s
subito-scraper:
build:
context: ./subito-scraper
dockerfile: Dockerfile.prod
restart: unless-stopped
depends_on:
db-api:
condition: service_healthy
environment:
- NODE_ENV=production
- PING_SERVER_PORT=3434
networks:
- db-api-network
healthcheck:
test: ["CMD-SHELL", "bun run /home/bun/app/healthcheck.js || exit 1"]
interval: 5s
timeout: 5s
retries: 3
start_period: 5s
zappyrent-scraper:
build:
context: ./zappyrent-scraper
dockerfile: Dockerfile.prod
restart: unless-stopped
environment:
- NODE_ENV=production
- PING_SERVER_PORT=3434
depends_on:
db-api:
condition: service_healthy
networks:
- db-api-network
healthcheck:
test: ["CMD-SHELL", "bun run /home/bun/app/healthcheck.js || exit 1"]
interval: 5s
timeout: 5s
retries: 3
start_period: 5s
immobiliare-scraper:
build:
context: ./immobiliare-scraper
dockerfile: Dockerfile.prod
restart: unless-stopped
environment:
- NODE_ENV=production
- PING_SERVER_PORT=3434
depends_on:
db-api:
condition: service_healthy
networks:
- db-api-network
healthcheck:
test: ["CMD-SHELL", "bun run /home/bun/app/healthcheck.js || exit 1"]
interval: 5s
timeout: 5s
retries: 3
start_period: 5s
bakeca-scraper:
build:
context: ./bakeca-scraper
dockerfile: Dockerfile.prod
restart: on-failure:5
environment:
- NODE_ENV=production
- PING_SERVER_PORT=3434
depends_on:
db-api:
condition: service_healthy
networks:
- db-api-network
healthcheck:
test: ["CMD-SHELL", "wget -q -O- http://localhost:3434/ping || exit 1"]
interval: 5s
timeout: 5s
retries: 3
start_period: 5s
# db-consumer da rifare con Bun
db-api:
build:
context: ./db-api
dockerfile: Dockerfile.prod
secrets:
- mongodb_uri
- mail_username
- mail_password
- geolocation_api_key
restart: unless-stopped
environment:
- NODE_ENV=production
- PORT=5500
- MAIL_SERVER=in-v3.mailjet.com
- SEND_EMAIL_FROM=info@bitrey.it
- SEND_EMAIL_TO=info@bitrey.it
networks:
- db-network
- db-api-network
healthcheck:
test:
["CMD-SHELL", "wget -q -O- http://localhost:5500/api/v1/ping || exit 1"]
interval: 10s
timeout: 10s
retries: 5
start_period: 10s
client-api:
build:
context: ./client-api
dockerfile: Dockerfile.prod
secrets:
- recaptcha_secret
- mongodb_uri
restart: unless-stopped
environment:
- NODE_ENV=production
- PORT=6500
networks:
- db-network
- public-network
healthcheck:
test:
["CMD-SHELL", "wget -q -O- http://localhost:6500/api/v1/ping || exit 1"]
interval: 10s
timeout: 10s
retries: 5
start_period: 10s
volumes:
db-data:
driver: local
networks:
db-network:
driver: bridge
db-api-network:
driver: bridge
public-network:
driver: bridge