generated from ddev/ddev-addon-template
-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
docker-compose.mongo.yaml
61 lines (59 loc) · 1.65 KB
/
docker-compose.mongo.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#ddev-generated
# Remove the line above if you don't want this file to be overwritten when you run
# ddev get ddev/ddev-mongo
#
# This file comes from https://github.com/ddev/ddev-mongo
#
services:
mongo:
container_name: ddev-${DDEV_SITENAME}-mongo
image: mongo:5-focal
volumes:
- type: "volume"
source: mongo
target: "/data/db"
volume:
nocopy: true
- type: "volume"
source: mongo-config
target: "/data/configdb"
volume:
nocopy: true
- ".:/mnt/ddev_config"
restart: "no"
expose:
- "27017"
labels:
com.ddev.site-name: ${DDEV_SITENAME}
com.ddev.approot: $DDEV_APPROOT
environment:
- MONGO_INITDB_ROOT_USERNAME=db
- MONGO_INITDB_ROOT_PASSWORD=db
# See https://github.com/docker-library/docs/tree/master/mongo#mongo_initdb_database
# - MONGO_INITDB_DATABASE=db
healthcheck:
test: ["CMD-SHELL", "mongo --eval 'db.runCommand(\"ping\").ok' localhost:27017/test --quiet"]
timeout: 60s
mongo-express:
container_name: ddev-${DDEV_SITENAME}-mongo-express
image: mongo-express:1.0
restart: "no"
labels:
com.ddev.site-name: ${DDEV_SITENAME}
com.ddev.approot: ${DDEV_APPROOT}
com.ddev.platform: ddev
expose:
- "8081"
environment:
VIRTUAL_HOST: $DDEV_HOSTNAME
ME_CONFIG_MONGODB_ENABLE_ADMIN: "true"
ME_CONFIG_BASICAUTH: "false"
ME_CONFIG_MONGODB_URL: "mongodb://db:db@mongo:27017"
HTTP_EXPOSE: "9091:8081"
HTTPS_EXPOSE: "9092:8081"
depends_on:
- mongo
entrypoint: [sh, -c, "sleep 5s && tini -- /docker-entrypoint.sh mongo-express"]
volumes:
mongo:
mongo-config: