-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
69 lines (64 loc) · 1.63 KB
/
docker-compose.yml
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
59
60
61
62
63
64
65
66
67
68
69
version: "3.8"
services:
mongo:
container_name: mongodb
image: mongo:5.0.9
restart: unless-stopped
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_USERNAME}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_PASSWORD}
ports:
- 27017:27017
volumes:
- ./internal/platform/mongo/initdb.d:/docker-entrypoint-initdb.d:ro
- mongo:/data/db
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongo 127.0.0.1:27017/test --quiet
interval: 30s
timeout: 10s
retries: 3
networks:
- mongodb-network
mongo-express:
container_name: mongo_express
image: mongo-express:1.0.0-alpha.4
restart: unless-stopped
environment:
ME_CONFIG_MONGODB_ADMINUSERNAME: ${MONGO_USERNAME}
ME_CONFIG_MONGODB_ADMINPASSWORD: ${MONGO_PASSWORD}
ME_CONFIG_MONGODB_SERVER: ${MONGO_HOST}
ME_CONFIG_MONGODB_PORT: ${MONGO_PORT}
ME_CONFIG_BASICAUTH_USERNAME: ${MONGO_USERNAME}
ME_CONFIG_BASICAUTH_PASSWORD: ${MONGO_PASSWORD}
ports:
- 8081:8081
depends_on:
mongo:
condition: service_healthy
networks:
- mongodb-network
todoapi:
container_name: todoapi
build:
context: .
dockerfile: ./Dockerfile
image: todoapi
ports:
- 8080:8080
restart: on-failure
healthcheck:
test: wget --quiet --tries=3 --spider http://localhost:8080/api/v1/health || exit 1
interval: 30s
timeout: 10s
retries: 3
depends_on:
mongo:
condition: service_healthy
networks:
- mongodb-network
networks:
mongodb-network:
driver: bridge
volumes:
mongo:
name: mongo