This repository is the hands-on project used in the Docker workshop.
The project is intentionally simple:
- Frontend: HTML, CSS and JavaScript
- Backend: Node.js + Express
- Database: MongoDB
- Database UI: Mongo Express
- Orchestration: Docker Compose
The application is a small registration demo. Participants enter a mock name, email and password, the browser sends the data to the Express backend, and the backend stores it in MongoDB.
The workshop also uses Mongo Express so participants can see the database directly, create databases and collections, and add documents themselves.
Important: Use fake data only. Do not enter a real password. This is a Docker teaching project, not a production authentication system.
Browser
│
│ http://localhost:5000
▼
Node.js + Express
│
│ Docker network: app-network
▼
MongoDB
Mongo Express
│
│ http://localhost:8080
▼
MongoDB
The browser-facing app runs on port 5000. Mongo Express runs on port 8080 on the host and connects to MongoDB over the Docker network.
Mongo Express login:
- Username:
admin - Password:
pass
Participants do not need to run npm install on their computer.
The Dockerfile installs the Node dependencies inside the image while the image is being built. The workshop therefore uses Docker to provide the application environment.
You only need Docker Desktop running. Git and VS Code are useful for working with the repository, but Node packages do not need to be installed on the host machine.
.
├── manual/
│ ├── README.md
│ └── backend/
│ ├── Dockerfile
│ ├── package.json
│ ├── server.js
│ └── public/
│
├── compose/
│ ├── README.md
│ ├── compose.yaml
│ └── backend/
│ ├── Dockerfile
│ ├── package.json
│ ├── server.js
│ └── public/
│
├── CHEATSHEET.md
└── INSTRUCTOR_GUIDE.md
There is deliberately no starter folder and no debugging exercise folder. The project is meant to be run with Docker from the beginning.
Use manual/README.md.
Participants will:
- Create a Docker network.
- Run MongoDB in a container.
- Run Mongo Express in another container.
- Use Mongo Express to create a database, collection and document.
- Build the Node/Express application image with a Dockerfile.
- Run the application container on the same Docker network.
- Open the app at
http://localhost:5000. - Submit mock registration data.
- Refresh Mongo Express and see the document in MongoDB.
- Preview Docker volumes as the Day 2 persistence topic.
Use compose/README.md.
Participants will replace the multiple docker run commands with one Compose file and run:
docker compose up --buildThen they can use:
- App:
http://localhost:5000 - Mongo Express:
http://localhost:8080
Manual setup:
docker rm -f fossmec-backend mongo-express mongo
docker network rm app-networkThis Day 1 project has no named MongoDB volume, so there is no volume cleanup step.
Compose setup:
docker compose downMake sure Docker Desktop is open and running.
Check the container:
docker psThen check its logs:
docker logs fossmec-backendFor Compose:
docker compose ps
docker compose logs appInside Docker, the MongoDB hostname is the container/service name, not localhost.
Manual setup uses:
MONGO_HOST=mongo
Compose uses the service name:
mongo
localhost inside the backend container means the backend container itself.
Check that the container is running:
docker psThen inspect its logs:
docker logs mongo-expressFor Compose:
docker compose logs mongo-expressIt does not need one for this project. MongoDB and the other containers communicate over their Docker network. Only the browser-facing services need host ports published.
The important lesson is not the registration application itself. The application exists to give you something real to put inside containers and connect together while learning:
images → containers → ports → environment variables → networks → Dockerfiles → Compose
Volumes and persistence are intentionally left for Day 2.