Skip to content

A production-ready FastAPI application scaffolded with Docker, PostgreSQL, Redis, and optional Nginx reverse proxy. This stack supports scalable backend development with service isolation, environment configuration, and container orchestration using Docker Compose.

Notifications You must be signed in to change notification settings

Mohamed-Magdy-Dewidar/Fastapi-Docker-Stack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 FastAPI Docker Stack Overview

A production-ready FastAPI application with Docker, PostgreSQL, Redis, and Nginx reverse proxy. Built for scalable backend development with service isolation and container orchestration.

📦 Features

  • 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

🏗️ Architecture

Application Architecture

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 Configuration

Service Role Port
web FastAPI app 6000
db PostgreSQL database 5432
cache Redis in-memory store 6379
proxy Nginx reverse proxy 806000

📁 Project Structure

Project Structure

🧪 Testing Endpoints and Verification

API Endpoints bash# Root endpoint

curl -v http://localhost/

FastApi Message

bash# Redis connection curl -v http://localhost/redis

Redis Message

bash# PostgreSQL connection curl -v http://localhost/postgres

Postgres Message

🔒 Security The application's Docker image has been scanned using Docker Scout:

Docker Scout Scanning result

The current scan shows only one high-severity vulnerability, making it relatively secure for most deployment scenarios.

🚀 Quick Start

Clone and Launch

# 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

About

A production-ready FastAPI application scaffolded with Docker, PostgreSQL, Redis, and optional Nginx reverse proxy. This stack supports scalable backend development with service isolation, environment configuration, and container orchestration using Docker Compose.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors