-
Notifications
You must be signed in to change notification settings - Fork 0
/
compose.yaml
42 lines (42 loc) · 1.22 KB
/
compose.yaml
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
name: mongo #will be used for network auto naming and image names
services:
app:
# image: registry.digitalocean.com/juronja/nodejs-app
image: 165.22.24.208:8083/nodejs-app #nexus repo
container_name: webpage
restart: unless-stopped
ports:
- 3000:3000
environment:
MONGO_ADMIN_USER: ${MONGO_ADMIN_USER}
MONGO_ADMIN_PASS: ${MONGO_ADMIN_PASS}
db:
image: mongo
container_name: mongo
restart: unless-stopped
ports:
- 27017:27017
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_ADMIN_USER}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_ADMIN_PASS}
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017/test --quiet
interval: 10s
start_period: 5s
volumes:
- mongodb:/data/db #Volume mapping for persistency
mongo-express:
image: mongo-express
container_name: mongo-express
restart: unless-stopped
depends_on:
db:
condition: service_healthy
ports:
- 8081:8081
environment:
ME_CONFIG_MONGODB_ADMINUSERNAME: ${MONGO_ADMIN_USER}
ME_CONFIG_MONGODB_ADMINPASSWORD: ${MONGO_ADMIN_PASS}
ME_CONFIG_MONGODB_SERVER: mongo
volumes:
mongodb: # It will prepend the project name