This is my first practical DevOps learning project.
The goal of this project is to learn how to build, containerize and run a small API with Docker and Docker Compose.
Python
FastAPI
Docker
Docker Compose
Git
GitHub
| Method | Endpoint | Description |
|---|---|---|
| GET | / | Returns the main status message |
| GET | /health | Returns the health status of the application |
| GET | /docs | Opens the automatic FastAPI documentation |
docker compose up --build
## Run with Kubernetes
This project can also be deployed to a local Kubernetes cluster.
### Apply the Kubernetes manifests
```bash
kubectl apply -f kubernetes/deployment.yaml
kubectl apply -f kubernetes/service.yamlkubectl get deployments
kubectl get pods
kubectl get serviceskubectl port-forward deployment/my-server 8080:8000Open the application in the browser:
http://localhost:8080
Health check:
http://localhost:8080/health
API documentation:
http://localhost:8080/docs
Press:
CTRL + C
| File | Description |
|---|---|
| kubernetes/deployment.yaml | Defines the application deployment |
| kubernetes/service.yaml | Exposes the application inside Kubernetes |