Careeroza
JobsMentorship

basic

FastAPI Introduction
What is FastAPI?
Installation & First App
Interactive Docs
Python Type Hints
Path & Query Parameters
Path Parameters
Query Parameters
Parameter Validation
Request Body & Pydantic
Pydantic Models
Request Body
Field Validation
Response Models
Responses & Errors
Status Codes
HTTPException
Response Types

medium

Dependencies
Dependency Injection
Dependencies with yield
Class-based & Global Dependencies
Routers & Project Structure
APIRouter
Project Layout
Settings & Configuration
Databases
CRUD with a Database
SQLAlchemy & SQLModel
Middleware & CORS
Middleware
CORS
Static Files

advance

Authentication & Security
Password Hashing
OAuth2 & JWT
API Security Checklist
Async & Background Tasks
async def vs def
Background Tasks
Lifespan Events
Testing
TestClient & pytest
Overriding Dependencies
Deployment
Production Server
Docker Image
Deploy to Cloud Run
Observability

interview-questions

Questions
Basic Interview Questions
Intermediate Interview Questions
Advanced Interview Questions

Docker Image

A Production Dockerfile

Example

Dockerfile

FROM python:3.12-slim
ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1
RUN useradd --create-home --uid 10001 app
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY --chown=app:app . .
USER app
EXPOSE 8080
CMD ["sh", "-c", "uvicorn main:app --host 0.0.0.0 --port ${PORT:-8080}"]

PORT is read from the environment because platforms like Cloud Run tell the container which port to listen on.