Docker
Generate Dockerfiles and Docker Compose configuration for Better Fullstack projects.
Open documentation actions
Docker is the best deployment target when you want portable production images, self-hosting, or a local environment that mirrors runtime services.
Create with Docker deployment files
npm create better-fullstack@latest my-app -- \
--frontend next \
--backend hono \
--runtime node \
--database postgres \
--orm drizzle \
--web-deploy docker \
--server-deploy dockerThe generator emits Dockerfiles for supported web and server apps. Docker deployment templates are separate from the docker-compose addon: deploy targets focus on production app images, while the addon generates local service orchestration.
Add Docker Compose
npm create better-fullstack@latest my-app -- \
--frontend react-vite \
--backend hono \
--runtime node \
--database postgres \
--orm drizzle \
--addons docker-composeDocker Compose support currently targets compatible TypeScript web/server stacks plus server-only Rust, Python, Go, and Spring Boot Java projects where the generator has a matching Dockerfile template.
Generated files
Depending on the stack, Docker support can emit:
- App-level
Dockerfilefiles for web and server services. .dockerignorefiles to keep builds small.docker-compose.ymlfor local web, API, database, cache, or search services.- Nginx config for static SPA serving when needed.
Production notes
Use production database credentials instead of local Compose service URLs when deploying to a host. Keep Compose volumes for local development data and make sure production migrations run before app startup.