Overview
Dokploy supports multiple build methods to transform your source code into Docker images. Each method is optimized for different languages, frameworks, and use cases.Build Methods
Dokploy provides six build methods:Nixpacks
Auto-detect framework and generate optimized builds
Dockerfile
Full control with custom Docker builds
Heroku Buildpacks
Heroku-compatible buildpacks
Paketo Buildpacks
Cloud Native Buildpacks standard
Railpack
Optimized Ruby on Rails builds
Static
Static site generation with nginx
Nixpacks (Recommended)
Nixpacks automatically detects your application’s framework and generates an optimized build configuration.Supported Frameworks
Nixpacks supports 20+ languages and frameworks:JavaScript / TypeScript
JavaScript / TypeScript
- Node.js - package.json with scripts
- Next.js - Automatic optimization
- React - CRA, Vite, or custom
- Vue.js - Vue CLI or Vite
- Angular - Angular CLI
- Svelte - SvelteKit or Vite
- Nuxt - SSR or static
- Remix - Full-stack framework
Python
Python
- Django - Web framework
- Flask - Microframework
- FastAPI - Modern async framework
- Streamlit - Data apps
Go
Go
- Standard Go - go.mod projects
- Gin - Web framework
- Echo - High performance
- Fiber - Express-inspired
Ruby
Ruby
- Ruby on Rails - Full-stack framework
- Sinatra - Lightweight framework
- Hanami - Modern framework
PHP
PHP
- Laravel - Web framework
- Symfony - Enterprise framework
- WordPress - CMS
Rust
Rust
- Cargo projects - Standard Rust apps
- Actix Web - High performance
- Rocket - Web framework
Java / JVM
Java / JVM
- Spring Boot - Enterprise framework
- Maven - Project management
- Gradle - Build automation
Configuration
How Nixpacks Works
Detection Phase
Nixpacks scans your repository for:
- Package manager files (package.json, requirements.txt, etc.)
- Framework-specific files (next.config.js, Cargo.toml, etc.)
- Lock files (package-lock.json, Cargo.lock, etc.)
Plan Generation
Based on detection, Nixpacks generates:
- Install commands (npm install, pip install, etc.)
- Build commands (npm run build, cargo build, etc.)
- Start commands (npm start, python app.py, etc.)
Dockerfile
Use custom Dockerfiles for full control over the build process.Configuration
Basic Dockerfile
Multi-Stage Builds
Specify which stage to use as the final image:Build Arguments
Pass build-time variables to Docker build:Build arguments are available during build but not in the final container. Use environment variables for runtime configuration.
Docker Context
Set the build context directory:Heroku Buildpacks
Use Heroku-compatible buildpacks for zero-configuration builds.Configuration
Supported Languages
Heroku buildpacks automatically detect:- Node.js (package.json)
- Python (requirements.txt, Pipfile)
- Ruby (Gemfile)
- PHP (composer.json)
- Java (pom.xml, build.gradle)
- Go (go.mod)
- Scala (build.sbt)
How It Works
Heroku buildpacks follow conventions:- Detect - Check for framework files
- Compile - Install dependencies and build
- Release - Generate start command
Paketo Buildpacks
Cloud Native Buildpacks compliant with OCI standards.Configuration
Advantages
- No Dockerfile - Auto-detect and build
- Rebasing - Update base image without rebuild
- BOM - Software Bill of Materials
- Security - Minimal attack surface
Supported Stacks
- Java (Spring Boot, Maven, Gradle)
- Node.js (npm, yarn, pnpm)
- Go (Go modules)
- .NET (ASP.NET Core)
- PHP (Composer)
- Ruby (Bundler)
- Python (pip, poetry)
Railpack
Optimized builds for Ruby on Rails applications.Configuration
Features
- Asset Precompilation - Automatic asset:precompile
- Database Migration - Optional db:migrate
- Yarn/npm - JavaScript dependency management
- Ruby Version - Automatic detection from .ruby-version
Requirements
Static Sites
Serve static websites with nginx.Configuration
Build Process
SPA Mode
Enable for single-page applications:index.html for all routes, allowing client-side routing to work.
Publish Directory
Specify where build output is located:Build Secrets
Pass sensitive values during build without exposing them in the final image.Configuration
Usage in Dockerfile
Build Optimization
Layer Caching
Order Dockerfile instructions for optimal caching:.dockerignore
Exclude unnecessary files from build context:Multi-Stage Benefits
Clean Cache
Force rebuild without using cache:Cache is automatically cleaned after the build. Enable
cleanCache only when needed.Troubleshooting
Build Fails - Dependencies Not Found
Build Fails - Dependencies Not Found
Symptoms: Module not found, package not installedSolutions:
- Verify dependency files are committed:
- Use appropriate install command:
- Enable clean cache:
Build Succeeds But App Won't Start
Build Succeeds But App Won't Start
Symptoms: Container exits immediately after startingSolutions:
- Check Dockerfile CMD/ENTRYPOINT:
- Verify build output location:
- Check application logs:
Build Too Slow
Build Too Slow
Symptoms: Builds take 10+ minutesSolutions:
- Optimize Dockerfile layer order
- Add .dockerignore file
- Use multi-stage builds
- Enable build cache:
- Use smaller base images:
Out of Disk Space
Out of Disk Space
Symptoms: No space left on deviceSolutions:
- Clean old images:
- Remove build cache:
- Check disk usage:
Next Steps
Environment Variables
Configure runtime environment
Git Integration
Automate builds from Git
Docker Registry
Push built images to registries
Deployments Overview
Learn about deployment workflows