-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
48 lines (45 loc) · 1.05 KB
/
docker-compose.yml
File metadata and controls
48 lines (45 loc) · 1.05 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
services:
# MongoDB service
mongodb:
image: mongo:latest
container_name: mongodb
ports:
- "27017:27017"
volumes:
- mongodb_data:/data/db
environment:
- MONGO_INITDB_ROOT_USERNAME=admin
- MONGO_INITDB_ROOT_PASSWORD=password123
healthcheck:
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')", "--quiet"]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
restart: always
networks:
- transaction-ledger-network
# API service
api:
build:
context: .
dockerfile: Dockerfile
container_name: transaction-ledger-api
ports:
- "3000:3000"
environment:
- NODE_ENV=development
- PORT=3000
- MONGODB_URI=mongodb://admin:password123@mongodb:27017/transaction_ledger?authSource=admin
depends_on:
mongodb:
condition: service_healthy
restart: always
networks:
- transaction-ledger-network
volumes:
mongodb_data:
driver: local
networks:
transaction-ledger-network:
driver: bridge