- This repository is for Implementation of a flask Application that provides API’s to monitor the server’s status (disks, memorys, and cpu), the application is implemeted by using docker and python to create a custom image for that app.
- Install the app image using this command
# docker run yaseenasaliya/flask_monitoring_app:v1
- Create docker compose file
start-program.yml
version: "3"
services:
flask_monitoring_app:
build: .
container_name: monitoring_app
ports:
- "80:80"
- Run compose file in background
# docker compose -f start-program.yml up -d
- Go to localhost url
http://localhost
- Build image localy with
v1
tage
# docker build . -t yaseenasaliya/flask_monitoring_app:v1
- Login to docker hub using the this command
# docker login
- Push the image
# docker push yaseenasaliya/flask_monitoring_app:v1
- Pull mariadb docker image
# docker pull mariadb
- Create docker compose file
setup-database.yml
with mariadb database image and create a new useryaseen
and database calledmonitoring_app
version: "3"
services:
db:
image: mariadb
container_name: my_db
env_file: .env
ports:
- "3306:3306"
- Create
.env
file
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: monitoring_app
MYSQL_USER: yaseen
MYSQL_PASSWORD: yaseen
- Run a docker compose file
# docker compose -f setup-database.yml up -d
- To connect to the database
# mysql -P 3306 --protocol=tcp -u yaseen -pyaseen
Here are some photos for collected usage