-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
34 lines (32 loc) · 797 Bytes
/
Copy pathdocker-compose.yml
File metadata and controls
34 lines (32 loc) · 797 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
services:
app:
build: .
container_name: url_shortener_app
ports:
- "8000:8000"
env_file:
- .env
depends_on:
mongodb:
condition: service_healthy
restart: unless-stopped
volumes:
- ./app:/app/app # live-reload friendly bind mount during development
mongodb:
image: mongo:7
container_name: url_shortener_mongo
ports:
- "27017:27017"
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_ROOT_USER:-mongo_user}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_ROOT_PASSWORD:-mongo_pass}
volumes:
- mongo_data:/data/db
healthcheck:
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
volumes:
mongo_data: