-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
31 lines (30 loc) · 807 Bytes
/
Copy pathdocker-compose.yml
File metadata and controls
31 lines (30 loc) · 807 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
version: '3.9'
services:
mongodb:
image: mongo:${MONGODB_VERSION:-5}
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: secret
MONGO_INITDB_DATABASE: e2e
MONGODB_VERSION: ${MONGODB_VERSION:-5}
healthcheck:
test: >
if [ "$(echo "${MONGODB_VERSION}" | cut -c1)" -ge "6" ]; then
echo 'db.runCommand("ping").ok' | mongosh --quiet
else
echo 'db.stats().ok' | mongo localhost:27017/e2e --quiet
fi
interval: 1s
timeout: 3s
retries: 10
volumes:
- /data/db
node:
container_name: node
build: .
tty: true
environment:
MONGODB_URL: mongodb://root:secret@mongodb:27017/e2e?authSource=admin
depends_on:
mongodb:
condition: service_healthy