A simple Flask-based To-Do REST API, fully containerized with Docker and integrated with a GitHub Actions CI/CD pipeline that automatically tests, builds, and publishes the Docker image to Docker Hub on every push to main.
- Backend: Python (Flask)
- Testing: Pytest
- Containerization: Docker
- CI/CD: GitHub Actions
- Registry: Docker Hub
- REST API for managing To-Do items (Create, Read, Update, Delete)
- Health check endpoint for monitoring
- Automated test suite run on every push/PR
- Automated Docker image build & push on every merge to
main
| Method | Endpoint | Description |
|---|---|---|
| GET | /health |
Health check |
| GET | /todos |
Get all todos |
| POST | /todos |
Create a new todo |
| PUT | /todos/<id> |
Update an existing todo |
| DELETE | /todos/<id> |
Delete a todo |
pip install -r requirements.txt
python app.pyAPI will be available at http://localhost:5000
docker build -t devops-todo-api .
docker run -p 5000:5000 devops-todo-apipip install pytest
pytest test_app.py -vdevops-todo-api/
├── app.py
├── test_app.py
├── requirements.txt
├── Dockerfile
├── .dockerignore
└── .github/
└── workflows/
└── ci-cd.yml
-by javeriadevops