This repository contains a simple Python Flask application that can be containerized using Docker, showcasing basic Flask functionality and pushes the Docker image to a Docker registry. The workflow is triggered on push to the main branch and also runs every Saturday at 7 PM.
Before running the application, ensure you have the following installed:
- Docker: Installation Guide
To run the Flask application locally:
- Clone this repository to your local machine.
- Open a terminal or command prompt and navigate to the project directory.
To build the Docker image, use the following command:
docker build -t flask-app .
To run the Docker container, execute the following command:
docker run -p 8080:5000 flask-app
The Flask application is accessible at http://localhost:8080
in your web browser.
This repository also includes a CI workflow set up with GitHub Actions. The CI workflow performs the following tasks:
- Builds the Docker image.
- Pushes the Docker image to a Docker registry.
The workflow is triggered on push to the main
branch and also runs every Saturday at 7 PM. set the cron using: Cron Expression Generator
To configure the CI workflow for your own project, make sure you have the following secrets set in your GitHub repository:
DOCKER_USERNAME
: Your Docker registry username.DOCKER_PASSWORD
: Your Docker registry password.
You can modify the workflow configuration in the .github/workflows/build.yml
file to suit your needs.
Enjoy