To containerize this project using Docker, follow these steps:
cd src
- Pull and run the MongoDB container:
docker run --name mongo -d --rm mongo
- Alternatively, to create a MongoDB container with a specific network and volume:
docker network create teamer-net
docker volume create teamer-vol
docker run --name mongo -d --rm --network teamer-net -v teamer-vol:/data/db mongo
- Build the Docker image for the Node.js application:
docker build -t teamer-frontend .
- Run the Node.js container:
docker run --rm -d --network teamer-net -p 3000:3000 --name teamer-frontend -v C:\%cd%\teamer-docker\src:/app teamer-frontend
replace %cd%
with current docker src
path.