Assignment 1 - Docker

15th Mar 2024

The task

Deploy a complete Docker web application with Docker application containers consisting of at least two services and at least one permanent volume.

The following should apply to each web application service:

  • listens on its port,
  • runs in its own Docker container,
  • can communicate with other services it needs.

At least one service should maintain its status through a permanent union.

You can use an existing image in the Docker Hub registry to design the service, e.g. database or web server. You can build your own images if you want. Configure services using configuration files, startup arguments, or environment variables.

Files to upload

The upload should include:

  • an application preparation script called prepare-app.sh. In the prepare-app.sh script, provide the docker commands needed to compile images and create configurations, networks, create and initialize named volumes.
  • bash script for start called start-app.sh. In the start-app.sh script, type the commands for the docker system to start and configure all web application service containers. Configure the containers to restart in the event of a failure. Write a message on which port I can connect to the application using a web browser.
  • bash script for the end called stop-app.sh. Write commands to stop all services in the stop-app.sh script. Pausing the application and restarting it should not cause a reset to the default state, even if the application configuration changes.
  • script to remove all tracks after the created remove-app.sh application. The script should remove everything created in the prepare-app.sh script.
  • If you want, you can use docker-compose or "docker swarm mode" for deployment. In this case, save the application configuration in the file docker-compose.yaml. '
  • Documentation file README.md.

Documentation

Enter in the documentation file:

  • Conditions for deploying and running your application - a detailed list of required software.
  • A description of what your application does.
  • Description of virtual networks and named volumes used by the application.
  • A description of the container configuration you performed.
  • List of containers used and a brief description thereof.
  • Instructions on how to prepare, run, pause and delete the application.
  • Instructions on how to view the application on the web.

Example of working with an application

Working with the application could look like this:

# I'll create everything I need for the application
./prepare-app.sh
Preparing app ...
# I'll run the application
./start-app.sh
Running app ...
The app is available at http://localhost:5000
# I open a web browser and work with the application.
# I will pause the application
./stop-app.sh
Stopping app ...
# I will delete everything related to the application
./remove-app.sh
Removed app.

Assume that the scripts are run on a computer with Linux installed and the docker command configured.

Upload

Create an empty repository named zkt24 on the department GITe. Upload the application files to the repository in the z1 directory.

Rating

The assignment will be evaluated personally.

In the evaluation, I will focus on the following areas:

  • Usability: Are the supplied scripts executable without errors?
  • Completeness: Do the uploaded files meet the conditions specified in the assignment?
  • Functionality: Does the web application work without problems?
  • Documentation: Is the documentation complete and true?
  • Editing: Is the documentation easy to read? Are the scripts clear?
  • Originality: Your personal input should be clear in the uploaded files. If you are inspired by an existing solution, state the source.

Previous Post

Assignment 1 - Docker