Task
Deploy a complete web application using Docker application containers, consisting of at least three services and at least one persistent volume.
Examples of services:
- web server for static files with frontend
- backend server - Node JS, Flask, django
- relational or NosqL Database
- Redis cache.
- File storage
- Monitoring of web application or web server logs.
- Web interface for working with the database.
Each web application service should:
- listen on its own port (public or virtual),
- run in its own Docker container,
- be able to communicate with other services it needs.
At least one service should maintain its state using a persistent volume.
You can use an existing image in the Docker Hub registry to design a service, e.g. a database or a web server. If you want, you can build your own images. Configure the services using configuration files, startup arguments, or environment variables.
Files to be submitted
The submission should include:
- a script for preparing the application called
prepare-app.sh. In theprepare-app.shscript, include the docker commands needed to build the images and create configurations, networks, and create and initialize named volumes. - a bash script for starting called
start-app.sh. In thestart-app.shscript, write the commands for the docker system to start and configure all the web application service containers. Configure the containers to restart in case of failure. Print a message on which port I can connect to the application using a web browser. - a bash script for stopping called
stop-app.sh. In thestop-app.shscript, write the commands to stop all the services. Pausing the application and restarting it should not reset it to its original state, even if the application configuration changes. - A script to remove all traces of the created application
remove-app.sh. The script should remove everything created in theprepare-app.shscript. - If you want, you can use docker-compose or "docker swarm mode" for deployment. In that case, save the application configuration to the
docker-compose.yamlfile. ' - A
README.mddocumentation file.
Documentation
Indicate in the documentation file:
- Conditions for deploying and launching your application - a detailed list of required software.
- A description of what your application does.
- A description of the virtual networks and named volumes that the application uses.
- A description of the container configuration you have made.
- A list of containers used and their brief descriptions.
- Instructions on how to prepare, launch, pause, and delete the application.
- Instructions on how to view the application on the web browser.
- List of used resources
- How to use artificial intelligence and list of used agents.
Example of working with the application
Working with the application could look like this:
# I will create everything needed for the application
./prepare-app.sh
Preparing app...
# I will start the application
./start-app.sh
Running app ...
The app is available at http://localhost:5000
# I will 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 will be executed on a computer with Linux installed and the docker command configured.
Submission
Create an empty repository named zkt26 on the department's GIT.
Upload the application files to the repository in the z1 directory.
Instructions for working with GIT.
The assignment defense will take place in the 7th week of the exercise.
Evaluation
I will focus on the following areas when evaluating:
- Personal responsibility: Ability to answer questions regarding the submitted code and documentation.
- Functionality: Does the web application work without problems? Are the supplied scripts executable without errors?
- Documentation: Is the documentation understandable, clear, complete and true?
- Editing: Is the documentation easy to read? Are the scripts clear?
- Originality: Your personal contribution should be clear in the submitted files. If you are inspired by an existing solution, please cite the source.
- Transparency: Are the sources listed and is the use of the AI agent correctly declared?