In this video, I'll walk you through setting up a development environment for a FastAPI application using PostgreSQL as the database, SQLAlchemy as the ORM, and Alembic for handling migrations – all running inside Docker and Docker Compose.
What we cover step by step:
- Creating the project structure
- Writing a Dockerfile for FastAPI
- Setting up PostgreSQL with persistent data
- Configuring SQLAlchemy 2.0 style with async support
- Adding Alembic for database migrations
- Using Docker Compose to run everything together (app + db)
- Hot-reloading during development using Docker Compose Watch
By the end, you'll have a fully working development setup that's easy to share with teammates, works the same on Windows, macOS, and Linux, and is ready for adding tests, linting, or deploying later.
Top comments (0)