-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
59 lines (54 loc) · 1.32 KB
/
docker-compose.yml
File metadata and controls
59 lines (54 loc) · 1.32 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
version: '3.8'
services:
# MongoDB service
mongodb:
image: mongo:7
container_name: checkdot-mongodb
restart: unless-stopped
ports:
- "27017:27017"
environment:
MONGO_INITDB_DATABASE: checkdot-lending
volumes:
- mongodb_data:/data/db
healthcheck:
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
interval: 10s
timeout: 5s
retries: 5
networks:
- checkdot-network
# Application service
app:
build:
context: .
dockerfile: Dockerfile
container_name: checkdot-lending-backend
restart: unless-stopped
ports:
- "${PORT:-8000}:8000"
environment:
- NODE_ENV=${NODE_ENV:-production}
- PORT=8000
- MONGODB_URI=mongodb://mongodb:27017/checkdot-lending
- PRIVATE_KEY=${PRIVATE_KEY}
# Add other environment variables as needed
env_file:
- .env
depends_on:
mongodb:
condition: service_healthy
networks:
- checkdot-network
healthcheck:
test: ["CMD", "node", "-e", "require('http').get('http://localhost:8000/health', (r) => {process.exit(r.statusCode === 200 ? 0 : 1)})"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
volumes:
mongodb_data:
driver: local
networks:
checkdot-network:
driver: bridge