-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.api.yml
More file actions
38 lines (36 loc) · 880 Bytes
/
Copy pathdocker-compose.api.yml
File metadata and controls
38 lines (36 loc) · 880 Bytes
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
services:
mongodb:
image: mongo:7
container_name: haunted-mongodb
restart: unless-stopped
ports:
- "27017:27017"
volumes:
- mongodb_data:/data/db
healthcheck:
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
interval: 10s
timeout: 5s
retries: 5
game-api:
build:
context: .
dockerfile: Dockerfile.api
container_name: haunted-game-api
depends_on:
mongodb:
condition: service_healthy
environment:
- MONGODB_URI=mongodb://mongodb:27017
- PORT=8000
- LOG_LEVEL=INFO
ports:
- "8000:8000"
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health', timeout=3)"]
interval: 15s
timeout: 5s
retries: 5
start_period: 20s
volumes:
mongodb_data: