initial
This commit is contained in:
commit
efbe10d664
46
z1/README.md
Normal file
46
z1/README.md
Normal file
@ -0,0 +1,46 @@
|
||||
Software Requirements
|
||||
|
||||
Docker version 20.10.5 or higher
|
||||
Docker Compose version 1.29.1 or higher
|
||||
|
||||
Application Description
|
||||
|
||||
The web application is a simple blogging platform that allows users to create, edit, and delete blog posts. The application uses a MySQL database to store blog post data and a httpd server.
|
||||
|
||||
|
||||
The application uses the following virtual networks and named volumes:
|
||||
|
||||
Named volumes:
|
||||
db_data: MySQL database data
|
||||
web_data: WEB code data
|
||||
|
||||
|
||||
The application consists of the following containers:
|
||||
|
||||
MySQL container: Used to store blog post data
|
||||
httpd container: PRovide de front-end
|
||||
|
||||
|
||||
To prepare the application, run the prepare-app.sh script. This script will perform the following tasks:
|
||||
|
||||
Compile Docker images for MySQL and HTTPD
|
||||
Create virtual networks and named volumes for the application
|
||||
Create and initialize the MySQL database
|
||||
|
||||
|
||||
|
||||
To run the application, run the start-app.sh script. This script will start all necessary containers, configure them to restart in the event of a failure, and display the port on which the application can be accessed.
|
||||
Pausing and Deleting the Application
|
||||
|
||||
To pause the application, use the docker-compose pause command. To delete the application, run the stop-app.sh script. This script will stop all running containers and remove all associated resources.
|
||||
Removing all Tracks of the Application
|
||||
|
||||
To remove all traces of the application, run the remove-app.sh script. This script will remove all containers, volumes, and networks created during the preparation and running of the application.
|
||||
Docker Compose
|
||||
|
||||
If desired, the application can be deployed using Docker Compose. The docker-compose.yaml file contains the necessary configurations for the MySQLand HTTPD.
|
||||
|
||||
|
||||
Conclusion
|
||||
|
||||
This document provides a detailed guide for deploying, running, and managing the web application using Docker. Please refer to the included scripts and configuration files for more information.
|
21
z1/docker-compose.yaml
Normal file
21
z1/docker-compose.yaml
Normal file
@ -0,0 +1,21 @@
|
||||
version: '3'
|
||||
services:
|
||||
web:
|
||||
image: httpd:latest
|
||||
ports:
|
||||
- "80:80"
|
||||
volumes:
|
||||
- web_data:/var/html/usr/local/apache2/htdocs/
|
||||
database:
|
||||
image: mysql:latest
|
||||
|
||||
volumes:
|
||||
- db_data:/var/lib/mysql
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: ass1root
|
||||
MYSQL_DATABASE: mydb
|
||||
MYSQL_USER: iban
|
||||
MYSQL_PASSWORD: ass1
|
||||
volumes:
|
||||
web_data:
|
||||
db_data:
|
7
z1/prepare-app.sh
Executable file
7
z1/prepare-app.sh
Executable file
@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
docker volume create web_data
|
||||
docker volume create db_data
|
||||
|
||||
|
||||
docker-compose up -d
|
4
z1/remove-app.sh
Executable file
4
z1/remove-app.sh
Executable file
@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
docker volume rm web_data
|
||||
docker volume rm db_data
|
4
z1/start-app.sh
Executable file
4
z1/start-app.sh
Executable file
@ -0,0 +1,4 @@
|
||||
#!/bin/bash
|
||||
|
||||
docker-compose up -d
|
||||
echo "The app is available at http://localhost:80"
|
3
z1/stop-app.sh
Executable file
3
z1/stop-app.sh
Executable file
@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
docker-compose down
|
Loading…
Reference in New Issue
Block a user