A production-ready FastAPI application with Docker, PostgreSQL, Redis, and Nginx reverse proxy. Built for scalable backend development with service isolation and container orchestration.
- ⚡ FastAPI — High-performance Python API framework
- 🐳 Docker & Compose — Containerized architecture
- 🐘 PostgreSQL — Robust SQL database
- 🚀 Redis — In-memory caching and message queuing
- 🌐 Nginx — Reverse proxy for production environments
- 🔧 Developer-friendly — Easy local development and deployment
The stack implements a modern containerized architecture where:
- FastAPI handles HTTP requests and business logic
- PostgreSQL provides persistent data storage
- Redis enables caching and message queuing
- Nginx serves as a reverse proxy, routing external traffic to the application
| Service | Role | Port |
|---|---|---|
web |
FastAPI app | 6000 |
db |
PostgreSQL database | 5432 |
cache |
Redis in-memory store | 6379 |
proxy |
Nginx reverse proxy | 80 → 6000 |
🧪 Testing Endpoints and Verification
API Endpoints bash# Root endpoint
curl -v http://localhost/
bash# Redis connection curl -v http://localhost/redis
bash# PostgreSQL connection curl -v http://localhost/postgres
🔒 Security The application's Docker image has been scanned using Docker Scout:
The current scan shows only one high-severity vulnerability, making it relatively secure for most deployment scenarios.
# Clone repository
git clone https://github.com/Mohamed-Magdy-Dewidar/Fastapi-Docker-Stack.git
cd fastapi-docker-stack
# Start all services
docker-compose up --build





