Project Implementation
Know what you need to implement the project in development mode.
Necessary services
The required files are provided for editing. The changes you need to make in them are also explained in this lesson.
Three services are needed in our main Compose file, namely, mongodb
, nodejs
, nginx
.
Docker network:
Connect the three containers/services with a Docker network named quiznet
.
MongoDB database (mongodb
container)
Add the following configurations under the service of mongodb
in docker-compose.yml
:
- Define the variables for accessing the database with the user ID
quizuser
and passwordquizpass
. - Specify the image, name of the container, and network. Also, expose the default port of MongoDB.
- Specify the Docker volume,
quizdata
, for question storage. The folders/data/db
should be mounted toquizdata
. - Also add
logging
property withdriver
set asnone
.
This completes our setting up of mongodb
.
Node.js application (nodejs
container)
Making Dockerfile for nodejs
Specify the Dockerfile commands that you need for your Node application in ...