A lightweight Python application containerized with Docker.
Follow these steps to build and run the application in a containerized environment.
Ensure you have Docker installed and running on your system.
The following command packages the Python script and the required environment into a Docker image.
docker build -t hello-world .Execute the image as a container to see the output.
docker run hello-world- Created a new directory for the Docker project
- Initialized a Python application with an
app.pyfile
- Created a
Dockerfilewith Python 3.9 slim base image - Configured the working directory and copied application files
- Exposed port 3000 for the application
- Set the command to run
python app.py
- Built the Docker image using
docker build -t hello-world . - Tested the container locally with
docker run hello-world - Verified the application runs correctly in the containerized environment
- Created GitHub Actions workflow (
.github/workflows/github-actions-demo.yml) - Configured automated build and push to Docker Hub on push to main branch
- Set up Docker Hub authentication using GitHub secrets
- Verified the CI/CD pipeline successfully builds and pushes the image to Docker Hub
Docker Hub Repository: https://hub.docker.com/r/olubanke/hello-world-app
This Docker Compose setup includes the following services:
- Grafana (Port 3000)
- Prometheus (Port 9090)
- Blackbox Exporter (Port 9115)
| Service | Port | Purpose |
|---|---|---|
| Grafana | 3000 | Web UI for visualizing Prometheus metrics |
| Prometheus | 9090 | Time-series database for storing metrics |
| Blackbox Exporter | 9115 | Probing endpoints over HTTP, HTTPS, DNS, TCP, ICMP |
docker-compose up -d
