Skip to content
Public template

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

Developing with Docker

Overview

This repository contains an interactive web application that tests your Docker knowledge while teaching you essential Docker concepts hands-on. The application consists of:

  • Frontend: Interactive quiz interface with randomly selected Docker MCQ questions
  • Backend: Node.js Express server handling quiz logic and scoring
  • Database: MongoDB for storing player scores and leaderboard data
  • Admin UI: Mongo Express for real-time database inspection

Repository Structure:

developing-with-docker/
├── app/
│   ├── server.js          # Node.js Express backend server
│   ├── package.json       # Node.js dependencies and scripts
│   ├── index.html         # Quiz application frontend
│   ├── questions.json     # Docker MCQ questions pool
│   └── images/            # Application assets
├── Dockerfile             # Instructions to build the app container for the Node.js app
├── docker-compose.yaml    # Multi-container orchestration config
├── Tutorial.md            # Step-by-step tutorial
└── README.md              # This file

Quick Start with Docker Compose

The fastest way to get the application running is using Docker Compose, which automates the setup of all services. We can use Docker Compose to build and launch the entire application stack with a single command.

Docker Compose diagram

Launch the Application

  1. Clone the repository (if you are launching the repository through GitHub codespaces, you can skip this step):

    git clone <repository-url>
    cd developing-with-docker
  2. Start all services using Docker Compose:

    docker-compose up

    This single command will:

    • Build the Node.js application image from the Dockerfile
    • Start MongoDB database container
    • Start Mongo Express admin interface
    • Create a Docker network for service communication
    • Set up persistent volume for database data
    • Configure all environment variables and port mappings

Once the services are up and running, you can access:

  • Quiz Application: localhost:3001
  • Mongo Express (Database Admin UI): localhost:20001
    • Username: admin
    • Password: pass
  • MongoDB Database: localhost:20000
    • Username: admin
    • Password: password

Note: If you are using codespaces to launch the application, please navigates to the appropriate URLs with forwarded ports under the "Ports" tab in VSCode.

Mongo Express login screen on port 20001

Testing the application:

  1. Open the quiz application at localhost:3001

alt text

  1. Answer the randomly selected Docker questions and submit your answers to see your score
  2. Check the leaderboard to see all submissions
  3. Visit Mongo Express at localhost:20001 to inspect the stored data

Mongo Express showing quiz scores

Quiz results and leaderboard

For more detailed explanations, please refer to the Tutorial.md file in this repository.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages