Skip to content

Commit

Permalink
feat(db): add MongoDB and Mongo-Express to Docker setup
Browse files Browse the repository at this point in the history
New configurations have been added to the Docker setup include MongoDB and Mongo-Express. The environment variables and service settings for these new components have been defined in the .env.dist and docker-compose.yml files respectively.
  • Loading branch information
joeyaurel committed Dec 31, 2023
1 parent 73ba5a6 commit 4fd5241
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .env.dist
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
MONGO_USERNAME=root
MONGO_PASSWORD=
MONGO_PORT=27017

MONGO_ADMIN_USERNAME=admin
MONGO_ADMIN_PASSWORD=pass
MONGO_ADMIN_PORT=8081

DISCORD_TOKEN=
DISCORD_GUILD=

Expand Down
28 changes: 28 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,35 @@
name: vale

volumes:
mongodb:

services:
main:
build: .
env_file: .env
restart: always
environment:
- MONGO_HOST="mongo"

mongo:
image: mongo:latest
restart: always
environment:
- MONGO_INITDB_ROOT_USERNAME=${MONGO_USERNAME}
- MONGO_INITDB_ROOT_PASSWORD=${MONGO_PASSWORD}
ports:
- "${MONGO_PORT}:27017"
volumes:
- mongodb:/data/db

mongo-express:
image: mongo-express
restart: always
ports:
- "${MONGO_ADMIN_PORT}:8081"
environment:
- ME_CONFIG_MONGODB_ADMINUSERNAME=${MONGO_USERNAME}
- ME_CONFIG_MONGODB_ADMINPASSWORD=${MONGO_PASSWORD}
- ME_CONFIG_MONGODB_URL=mongodb://${MONGO_USERNAME}:${MONGO_PASSWORD}@mongo:${MONGO_PORT}/
- ME_CONFIG_MONGODB_AUTH_USERNAME=${MONGO_ADMIN_USERNAME}
- ME_CONFIG_MONGODB_AUTH_PASSWORD=${MONGO_ADMIN_PASSWORD}

0 comments on commit 4fd5241

Please sign in to comment.