-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
51 lines (51 loc) · 1.29 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
networks:
mongo-network:
driver: bridge
name: mongo-network
services:
mongodb:
image: mongo:latest
container_name: mongodb
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_DB_ADMIN_USER}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_DB_ADMIN_PASSWD}
networks:
- mongo-network
ports:
- 27017:27017
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh mongodb://${MONGO_DB_ADMIN_USER}:${MONGO_DB_ADMIN_PASSWD}@localhost:27017/ --quiet
interval: 5s
timeout: 10s
retries: 3
mongo-express:
image: mongo-express:latest
container_name: mongo-express
environment:
ME_CONFIG_MONGODB_ADMINUSERNAME: ${MONGO_DB_ADMIN_USER}
ME_CONFIG_MONGODB_ADMINPASSWORD: ${MONGO_DB_ADMIN_PASSWD}
ME_CONFIG_MONGODB_SERVER: mongodb
depends_on:
mongodb:
condition: service_healthy
networks:
- mongo-network
ports:
- 8081:8081
app:
build:
context: .
dockerfile: ./app/Dockerfile
target: prod
container_name: web-app
image: web-app
networks:
- mongo-network
environment:
MONGO_DB_USERNAME: ${MONGO_DB_ADMIN_USER}
MONGO_DB_PWD: ${MONGO_DB_ADMIN_PASSWD}
ports:
- 3000:3000
depends_on:
mongodb:
condition: service_healthy