...

/

Project Implementation

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:

  1. Define the variables for accessing the database with the user ID quizuser and password quizpass.
  2. Specify the image, name of the container, and network. Also, expose the default port of MongoDB.
  3. Specify the Docker volume, quizdata, for question storage. The folders /data/db should be mounted to quizdata.
  4. Also add logging property with driver set as none.

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 ...