Sign inSign up

amirtheswe/docker-compose-mongo-demo

By amirtheswe

•Updated 8 days ago

Node.js portfolio app that reads its content from MongoDB. Runs with Docker Compose.

Image
Integration & delivery
0

66

amirtheswe/docker-compose-mongo-demo repository overview

⁠docker-compose-mongo-demo

A Node.js portfolio page that reads its content (profile, projects, skills, experience) from MongoDB. Source and full Compose setup: https://github.com/amirtheswe/docker-compose-mongo-demo⁠

The image needs a MongoDB to talk to, which the Compose file in the GitHub repo provides:

   git clone https://github.com/amirtheswe/docker-compose-mongo-demo
   cd docker-compose-mongo-demo
   printf "MONGO_USER=admin\nMONGO_PASSWORD=choose-a-password\n" > .env
   docker compose up -d --build

Then open http://localhost:3000⁠.

⁠Run just the image

Put it on the same Docker network as a running MongoDB:

   docker run -d -p 3000:3000 --network <network> \
     -e MONGO_DB_USERNAME=<user> -e MONGO_DB_PWD=<password> \
     -e MONGO_HOST=<mongo hostname> \
     amirtheswe/docker-compose-mongo-demo:1.0

⁠Environment variables

VariableMeaningDefault
MONGO_DB_USERNAMEMongoDB usernone
MONGO_DB_PWDMongoDB passwordnone
MONGO_HOSTMongoDB hostnamemongodb
DB_NAMEDatabase nameportfolio

Listens on port 3000, runs as the non-root node user, and has a healthcheck. On first start it fills any empty collections with starting data.

Tag summary

Content type

Image

Digest

sha256:64be6feb4…

Size

56.2 MB

Last updated

8 days ago

docker pull amirtheswe/docker-compose-mongo-demo