-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
26 lines (24 loc) · 797 Bytes
/
docker-compose.yaml
File metadata and controls
26 lines (24 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
name: orders
services:
database:
image: mongodb/mongodb-community-server
container_name: orders_db
environment:
# Root admin user (for initial setup only)
MONGO_INITDB_ROOT_USERNAME: admin
MONGO_INITDB_ROOT_PASSWORD: badpassword
# Target database for initialization
MONGO_INITDB_DATABASE: ecommerce
ports:
- "27022:27017"
volumes:
- data_store:/data/db
- ./localDevelopment/init-mongo.js:/docker-entrypoint-initdb.d/init-mongo.js:ro
healthcheck:
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
volumes:
data_store: