A multi-service containerized application template with CI/CD pipeline, perfect for getting started with microservices on AWS or any container platform.
This starter app consists of three main services:
- Frontend: NGINX serving a static page with API proxy
- API: FastAPI backend with health endpoints
- Worker: Python heartbeat worker service
- π³ Containerized: All services run in Docker containers
- π CI/CD Ready: GitHub Actions workflow for automated builds
- π¦ Multi-Registry: Pushes to both GitHub Container Registry and Docker Hub
- π§ͺ Testing: Basic health checks and API tests
- π οΈ Development Tools: Makefile for common operations
- π Clean Structure: Sensible .gitignore and .dockerignore files
- Docker and Docker Compose
- Make (optional, but recommended)
# Clone the repository
git clone <your-repo-url>
cd aws-starter
# Start all services
docker-compose up --build- Frontend: http://localhost:8080
- API: http://localhost:8000
- API Docs: http://localhost:8000/docs (FastAPI auto-generated)
# See all available commands
make help
# Build all images
make build
# Start services
make compose-up
# Run tests
make test
# Stop services
make compose-down
# Clean up
make cleanaws-starter/
βββ frontend/ # NGINX + Static HTML
β βββ Dockerfile
β βββ nginx.conf
β βββ index.html
βββ api/ # FastAPI Backend
β βββ Dockerfile
β βββ requirements.txt
β βββ main.py
βββ worker/ # Python Worker
β βββ Dockerfile
β βββ requirements.txt
β βββ worker.py
βββ .github/workflows/ # CI/CD Pipeline
β βββ ci.yml
βββ docker-compose.yml
βββ Makefile
βββ README.md
GET /- Welcome message with timestampGET /health- Health check endpointGET /docs- Interactive API documentation
HEARTBEAT_INTERVAL- Heartbeat interval in seconds (default: 30)
ENV- Environment name (development, production)
# Push to GHCR (requires authentication)
make push-ghcr GITHUB_REPO=username/repo-name# Push to Docker Hub (requires authentication)
make push-dhub DOCKER_USERNAME=your-usernameThe GitHub Actions workflow automatically:
- Builds all service images
- Pushes to GitHub Container Registry (always)
- Pushes to Docker Hub (if secrets configured)
- Tests the deployed services
- Runs on push to main/develop and pull requests
For Docker Hub integration, add these GitHub secrets:
DOCKERHUB_USERNAME- Your Docker Hub usernameDOCKERHUB_TOKEN- Your Docker Hub access token
# Start services
make compose-up
# Run basic tests
make test
# Check specific endpoints
curl http://localhost:8000/
curl http://localhost:8000/health
curl http://localhost:8080/The CI pipeline includes:
- Service health checks
- API endpoint testing
- Worker heartbeat verification
- Create a new directory (e.g.,
database/) - Add
Dockerfileand application code - Update
docker-compose.yml - Add to CI workflow matrix in
.github/workflows/ci.yml - Update Makefile if needed
- Frontend: Edit
frontend/index.htmlorfrontend/nginx.conf - API: Modify
api/main.pyand updateapi/requirements.txt - Worker: Update
worker/worker.pylogic
- Port conflicts: Change ports in
docker-compose.ymlif 8080/8000 are in use - Permission errors: Ensure Docker daemon is running and user has permissions
- Build failures: Check Dockerfile syntax and dependencies
# View logs for all services
docker-compose logs
# View logs for specific service
docker-compose logs api
# Execute commands in running container
docker-compose exec api bash- Fork the repository
- Create a feature branch
- Make your changes
- Test locally with
make test - Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.