-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.yaml
More file actions
62 lines (59 loc) · 1.59 KB
/
compose.yaml
File metadata and controls
62 lines (59 loc) · 1.59 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
services:
mongo:
image: mongo:7.0
restart: unless-stopped
environment:
MONGO_INITDB_DATABASE: fiap-blog
volumes:
- mongo_data:/data/db
healthcheck:
test: ['CMD', 'mongosh', '--quiet', '--eval', "db.adminCommand({ ping: 1 })"]
interval: 10s
timeout: 5s
retries: 5
start_period: 15s
backend:
build:
context: tech_challenge1/backend
dockerfile: ./Dockerfile
image: fiap-pt-fsdt-backend:latest
depends_on:
mongo:
condition: service_healthy
environment:
NODE_ENV: production
PORT: 3000
MONGO_URI: mongodb://mongo:27017/fiap-blog
JWT_SECRET: ${JWT_SECRET:?Set JWT_SECRET in your .env file before running docker compose}
JWT_EXPIRES_IN: 7d
ENABLE_SWAGGER_UI: 'true'
ports:
- ${BACKEND_PORT:-3000}:3000
restart: unless-stopped
healthcheck:
test: ['CMD-SHELL', 'wget -qO- http://127.0.0.1:3000/health || exit 1']
interval: 15s
timeout: 5s
retries: 5
start_period: 20s
frontend:
build:
context: tech_challenge1/frontend
dockerfile: ./Dockerfile
args:
VITE_API_BASE_URL: /api
image: fiap-pt-fsdt-frontend:latest
depends_on:
backend:
condition: service_healthy
ports:
- ${FRONTEND_PORT:-8080}:8080
restart: unless-stopped
healthcheck:
test: ['CMD-SHELL', 'wget -qO- http://127.0.0.1:8080/healthz || exit 1']
interval: 15s
timeout: 5s
retries: 5
start_period: 15s
volumes:
mongo_data: