Skip to content

Commit

Permalink
Implement mongo express (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
pablomendezroyo authored Apr 8, 2024
1 parent 4d0653b commit 681ed15
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 7 deletions.
6 changes: 6 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
MONGO_INITDB_ROOT_USERNAME=
MONGO_INITDB_ROOT_PASSWORD=
MONGO_DB_NAME=
MONGO_DB_API_PORT=
API_PORT=
LOG_LEVEL=
30 changes: 23 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,41 @@ services:
ports:
- "8080:8080"
environment:
MONGO_DB_URI: "mongodb://${MONGO_INITDB_ROOT_USERNAME}:${MONGO_INITDB_ROOT_PASSWORD}@mongo:27017"
MONGO_DB_URI: "mongodb://${MONGO_INITDB_ROOT_USERNAME}:${MONGO_INITDB_ROOT_PASSWORD}@mongo:${MONGO_DB_API_PORT}"
MONGO_DB_NAME: "${MONGO_DB_NAME}"
API_PORT: "${API_PORT}"
LOG_LEVEL: "${LOG_LEVEL}"
depends_on:
- mongo
- mongo
container_name: listener

ui:
build:
context: ui
environment:
ME_CONFIG_MONGODB_URL: "mongodb://${MONGO_INITDB_ROOT_USERNAME}:${MONGO_INITDB_ROOT_PASSWORD}@mongo:${MONGO_DB_API_PORT}"
ME_CONFIG_MONGODB_SERVER: "mongo"
ME_CONFIG_MONGODB_ENABLE_ADMIN: "true"
ME_CONFIG_MONGODB_ADMINUSERNAME: "${MONGO_INITDB_ROOT_USERNAME}"
ME_CONFIG_MONGODB_ADMINPASSWORD: "${MONGO_INITDB_ROOT_PASSWORD}"
ME_CONFIG_BASICAUTH_USERNAME: "${MONGO_INITDB_ROOT_USERNAME}"
ME_CONFIG_BASICAUTH_PASSWORD: "${MONGO_INITDB_ROOT_PASSWORD}"
PORT: 8081
depends_on:
- mongo
container_name: ui

mongo:
image: "mongo:7.0.6"
ports:
- "27017:27017"
build:
context: mongo
volumes:
- mongo-data:/data/db
- ./mongo-config:/etc/mongo
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_INITDB_ROOT_USERNAME}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_INITDB_ROOT_PASSWORD}
MONGO_INITDB_DATABASE: "${MONGO_DB_NAME}"
command: ["mongod", "--config", "/etc/mongo/mongod.conf"]
container_name: mongo

volumes:
mongo-data:
mongo-data:
5 changes: 5 additions & 0 deletions mongo/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM mongo:7.0.6

COPY ./mongod.conf /etc/mongo/mongod.conf

EXPOSE 27017
File renamed without changes.
3 changes: 3 additions & 0 deletions ui/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM mongo-express:1.0.2

EXPOSE 8081

0 comments on commit 681ed15

Please sign in to comment.