docker:init
Generate a production-ready, multi-stage Dockerfile optimized for Rust applications.What It Creates
Dockerfile Features
The generated Dockerfile uses a multi-stage build for optimal image size:- Stage 1: Frontend Build - Builds the frontend assets using Node.js
- Stage 2: Backend Build - Compiles the Rust application with release optimizations
- Stage 3: Runtime - Minimal Debian-based image with only runtime dependencies
Building and Running
After generating the Dockerfile:docker:compose
Generate adocker-compose.yml file for local development with common services.
Options
Default Services
PostgreSQL and Redis are always included:Optional Services
When prompted (or using flags), you can add:Examples
Generated Configuration
The generateddocker-compose.yml includes:
- Environment variable defaults - Uses
${VAR:-default}syntax for easy customization - Health checks - All services include health checks for reliability
- Persistent volumes - Data is preserved between container restarts
- Custom network - Services communicate on an isolated network
Using the Services
Start all services:Environment Configuration
Update your.env file to use the Docker services:
Customizing Ports
Override default ports using environment variables:Service URLs
After starting, access services at:Mailpit captures all outgoing emails from your application. Access the web UI to view sent emails during development.
Unified Binary Commands
Your Kit application builds to a single binary with multiple commands:Production Deployment
For production deployment:-
Generate Dockerfile
-
Build the image
-
Run