Потрібно зробити завдання з мінімальними поясненнями у mobaxterm на linux ubuntu. завдвння виконується у закритій мережі так що images вжу встановлені файлом на самому комп'ютері
Create a docker swarm:
node-1 being the manager of the swarm and node-2 and node-3 being the workers
Prepare a Static HTML Page:
Provide a simple HTML file (e.g., index.html) that should be served by the Nginx web server
- it should include welcome text and a picture
Create a Dockerfile:
Write a Dockerfile to set up an Nginx server that will serve the provided HTML file.
The Dockerfile should:
- Use the nginx: 1.21.6 image in /root (load it if necessary)
- Copy the index.html file into the appropriate directory for Nginx to serve it.
Create a docker-compose.yml file for the keepalived:
Write a docker-compose.yml file to run the keepalived image:
Use the keepalived image in /root (load it if necessary)
run docker-compose.yml on each worker node separately and not in swarm mode (it is recommended to use env file)
Create a docker-compose.yml file for the nginx swarm:
Write a docker-compose.yml file to run the image you created:
it should map port 80 on the host to port 80 in the container.
Write a Bash Script:
Write a Bash script (setup.sh) that:
Builds the docker image from the Dockerfile.
Runs the nginx docker stack via the docker-compose.yml to both workers.
Prints a message indicating that the server is running and accessible.
Final tests:
access http://<virtual_ip> and see that your html page is ok
shut down active node and see that the other node takes the virtual ip
access http://<virtual_ip> again and see that your html page is ok