Skip to content

Commit

Permalink
initial commit (mongodb + mongo express)
Browse files Browse the repository at this point in the history
  • Loading branch information
aDorofeev committed Dec 2, 2018
0 parents commit 84c80e2
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .env.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
COMPOSE_PROJECT_NAME=mongodb
COMPOSE_FILE=compose/mongodb.yml:compose/mongo-express.yml
MONGODB_APN_HOSTNAME=mongo-node.appname

MONGODB_DATABASE=
MONGODB_USERNAME=
MONGODB_PASSWORD=

MONGO_EXPRESS_VIRTUAL_HOST=express.mongo.appdomain.com
MONGO_EXPRESS_AUTH_USER=
MONGO_EXPRESS_AUTH_PASS=

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.env
volumes/mongodb
28 changes: 28 additions & 0 deletions compose/mongo-express.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
version: '3.7'

services:
mongo-express:
image: mongo-express
depends_on:
- mongodb
restart: unless-stopped
expose:
- 8081
environment:
VIRTUAL_HOST: ${MONGO_EXPRESS_VIRTUAL_HOST}
VIRTUAL_PORT: 8081
ME_CONFIG_MONGODB_SERVER: "mongodb.compose"
#ME_CONFIG_MONGODB_ADMINUSERNAME: "root"
#ME_CONFIG_MONGODB_ADMINPASSWORD: "${MONGODB_ROOT_PASSWORD}"
ME_CONFIG_BASICAUTH_USERNAME: ${MONGO_EXPRESS_AUTH_USER}
ME_CONFIG_BASICAUTH_PASSWORD: ${MONGO_EXPRESS_AUTH_PASS}
networks:
default:
aliases:
- mongo-express.compose
nginx-proxy: ~

networks:
nginx-proxy:
external: true

25 changes: 25 additions & 0 deletions compose/mongodb.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
version: '3.7'

services:
mongodb:
image: 'mongo'
restart: always
labels:
kompose.service.type: nodeport
expose:
- 27017
volumes:
- ../volumes/mongodb:/data/db
networks:
default:
aliases:
- mongodb.compose
- mongo
application-network:
aliases:
- "${MONGODB_APN_HOSTNAME}"

networks:
application-network:
external: true

Empty file added volumes/mongodb/.gitkeep
Empty file.

0 comments on commit 84c80e2

Please sign in to comment.