zkt25/ z2
2025-05-13 06:43:28 +00:00
..
app Загрузить файлы в « z2/app» 2025-04-10 08:23:30 +00:00
nginx Загрузить файлы в « z2/nginx» 2025-04-10 08:23:05 +00:00
deployment.yaml Загрузить файлы в « z2» 2025-04-10 08:22:41 +00:00
docker-compose.yml Загрузить файлы в « z2» 2025-04-10 08:22:41 +00:00
Dockerfile Загрузить файлы в « z2» 2025-04-10 08:22:41 +00:00
namespace.yaml Загрузить файлы в « z2» 2025-04-10 08:22:41 +00:00
prepare-app.sh Обновить z2/prepare-app.sh 2025-05-13 06:43:28 +00:00
README.md Обновить z2/README.md 2025-04-10 08:37:55 +00:00
remove-app.sh Загрузить файлы в « z2» 2025-04-10 08:22:41 +00:00
service.yaml Загрузить файлы в « z2» 2025-04-10 08:22:41 +00:00
start-app.sh Загрузить файлы в « z2» 2025-04-10 08:22:41 +00:00
statefulset.yaml Загрузить файлы в « z2» 2025-04-10 08:22:41 +00:00
stop-app.sh Загрузить файлы в « z2» 2025-04-10 08:22:41 +00:00

Docker Web Application with MySQL and Nginx

Requirements

  • Docker
  • Docker Compose

Description

This web application consists of two services:

  1. A web service using Nginx to serve static HTML files.
  2. A database service using MySQL, which persists its data in a Docker volume.

Docker Volumes and Networks

  • Volume: db_data - used to persist MySQL data.
  • Network: app-network - internal network for the services to communicate.

Configuration

  • Nginx: Serves static HTML files from the /html directory.
  • MySQL: Configured with MYSQL_ROOT_PASSWORD and a default database mydb.

How to Use

Preparing the app

Run the following command to prepare the application:

./prepare-app.sh

Starting the app

To start the app, run:

./start-app.sh

The app will be available at http://localhost:5000.

Stopping the app

To stop the app, run:

./stop-app.sh

Removing the app

To remove all resources related to the app, run:

./remove-app.sh

Example usage

kubectl get pods -n webapp

kubectl get svc -n webapp

Stop the app

./stop-app.sh Stopping app...

Remove the app

./remove-app.sh Removed app.