A resume-ready Flask project that exposes a small task management REST API and demonstrates containerization, automated testing, and GitHub Actions based CI/CD.
GET /healthfor service and container health checksGET /tasksto list tasksPOST /tasksto create a taskPUT /tasks/<id>to update task title, description, or completion statuspytestcoverage for API behavior and validation paths- Non-root Docker image with container health checks
docker-composesetup for local app startup and optional containerized test runs- GitHub Actions workflow that:
- runs tests on every push and pull request
- builds and pushes a Docker image to GHCR on pushes to
main
task-api-devops-project/
|-- app/
| `-- main.py
|-- tests/
| `-- test_main.py
|-- .github/workflows/ci.yml
|-- Dockerfile
|-- docker-compose.yml
|-- requirements.txt
`-- README.md
python -m venv .venv
.venv\Scripts\activate
pip install -r requirements.txt
python app/main.pyThe API will be available at http://localhost:5000.
pytest -vdocker build -t task-api .
docker run -p 5000:5000 task-apidocker compose up --buildTo run the tests inside containers:
docker compose --profile test up --build task-api-testsCreate a task:
curl -X POST http://localhost:5000/tasks \
-H "Content-Type: application/json" \
-d "{\"title\":\"Add GHCR publishing\",\"description\":\"Push image on main\"}"Update a task:
curl -X PUT http://localhost:5000/tasks/2 \
-H "Content-Type: application/json" \
-d "{\"done\":true}"The workflow in .github/workflows/ci.yml uses the built-in GITHUB_TOKEN to authenticate to GHCR. After pushing this folder to a GitHub repository, merges to main will publish:
ghcr.io/<your-github-username>/task-api:latest
Task API - Dockerized CI/CD Pipeline | Python (Flask) | Docker | GitHub Actions | pytest
- Built a small REST API with health check, create/list/update task endpoints and automated tests.
- Containerized the service with a non-root Docker image, Docker health checks, and docker-compose for local orchestration.
- Set up a GitHub Actions pipeline to run tests on every push and pull request, then build and push an image to GHCR on merges to
main.