-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
54 lines (50 loc) · 1.36 KB
/
docker-compose.yml
File metadata and controls
54 lines (50 loc) · 1.36 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
# ============================================================
# FINEXA API — Docker Compose (Isolado com MongoDB)
#
# Para subir: docker-compose up --build -d
# Para parar: docker-compose down
# Para logs: docker-compose logs -f api
# Para limpar: docker-compose down -v (remove volumes)
# ============================================================
version: "3.8"
services:
# MongoDB Database
mongodb:
image: mongo:7
container_name: finexa-mongodb
restart: unless-stopped
ports:
- "27017:27017"
volumes:
- mongodb-data:/data/db
environment:
- MONGO_INITDB_DATABASE=finexa
healthcheck:
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
interval: 10s
timeout: 5s
retries: 5
# API Application
api:
build: .
container_name: finexa-api
restart: unless-stopped
ports:
- "3000:3000"
depends_on:
mongodb:
condition: service_healthy
environment:
- PORT=3000
- NODE_ENV=production
- MONGODB_URI=mongodb://mongodb:27017/finexa
- JWT_SECRET=finexa-secret-key-change-in-production-2024
- JWT_EXPIRES_IN=7d
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/api/health"]
interval: 30s
timeout: 10s
retries: 3
volumes:
mongodb-data:
driver: local