A minimal, batteries-included dev container for building full-stack apps with Next.js and FastAPI—no local setup required.
- ⚡️ Fast tooling via
Bunanduv - 🧠 Linting with
ESLintandruff - 🎨 Formatting with
Prettierandruff - 🔍 Static type checking with
TypeScriptandty - 🪝 Automatic checks via
pre-commithooks - 🛠️ Simple developer workflow via
Makefile - 🐳
Docker-in-Dockersupport - 🔁 Persistent
shellhistory across container rebuilds
Make sure you have the following dependencies installed:
DockerVS Codewith the "Dev Containers" extension
Note: This dev container is made specifically for
VS Code, but it should work with any IDE that has a "Dev Containers" plugin.
- Clone the repo
git clone https://github.com/rdguzman-swe/fastapi-nextjs-dev-container.git <your-project>- Open in
VS Code
code <your-project>-
Reopen in container
Cmd/Ctrl + Shift + P- Select
Dev Containers: Reopen in Container
-
Initialize project
make initThis will scaffold the backend and frontend and install all dependencies.
Start/open dev container
Cmd/Ctrl + Shift + P- Select
Dev Containers: Reopen in Container
Stop/close dev container
Cmd/Ctrl + Shift + P- Select
Dev Containers: Reopen Folder Locally
.
├── .devcontainer/ # Dev container config
├── backend/ # FastAPI app (created on scaffold)
├── frontend/ # Next.js app (created on scaffold)
├── .gitignore
├── .pre-commit-config.yaml # pre-commit hooks
├── .python-version
├── LICENSE.txt
├── Makefile # Developer commands
└── README.mdRun make help to see a list of all available commands:
make help| Command | Description |
|---|---|
make init |
Full setup (scaffold + install) |
make scaffold |
Create backend & frontend if missing |
make frontend |
Run Next.js dev server (http://localhost:3000) |
make backend |
Run FastAPI server (http://localhost:8000) |
make post-create |
Re-run container setup script |
This dev container includes pre-commit hooks to automatically run checks before each commit:
| Hook | Role |
|---|---|
eslint |
TypeScript linting |
prettier |
TypeScript formatting |
ruff-check |
Python linting |
ruff-format |
Python formatting |
ty |
Python type checking |
Hooks are automatically installed when the dev container is created.
This dev container is based on Debian 12 and comes with the following tools and VS Code extensions.
Zsh(Z shell)Oh My Zsh!GitcurlBunuvPython
Tailwind CSSESLintPrettierPythonPylanceRufftyDocker
The default Python version for this dev container is Python 3.13. To use a different version, modify the .python-version file as follows:
3.13 -> <your-version>Make sure to rebuild the dev container to see the changes.
This project is licensed under the MIT License.