Skip to content

Repository files navigation

Docker Practice Project

Using mongo and mongo-express docker images

Commands to create containers (choose only one way)

1. Manually

Run backend API in vs code

node server.js

Create specific network

docker network create mongo-network

Create mongo container

docker run -d ^
-p 27017:27017 ^
--name mongo ^
--network mongo-network ^
-e MONGO_INITDB_ROOT_USERNAME=admin ^
-e MONGO_INITDB_ROOT_PASSWORD=amar ^
mongo

Note: - linebreak with caret(^) in command prompt and backtick(`) in powershell

Create mongo-express container

docker run -d ^
-p 8081:8081 ^
--name mongo-express ^
--network mongo-network ^
-e ME_CONFIG_MONGODB_ADMINUSERNAME=admin ^
-e ME_CONFIG_MONGODB_ADMINPASSWORD=amar ^
-e ME_CONFIG_MONGODB_URL="mongodb://admin:amar@mongo:27017" ^
mongo-express

2. With Compose.yaml file

docker compose -f compose.yaml up -d

Note: - It will create a network & create and run 3 containers and connect them with network.

Access the UI and DB

Access http://localhost:5050 in browser to interact with UI where you can add user and see all users.

Access http://localhost:8081 in browser and enter Username = admin & Password = pass (default) to sign in to MongoDB UI.

UI Screenshots

Docker Practice UI

Docker Practice UI

MongoDB UI

MongoDB UI

About

Docker Practice Project

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages