Skip to main content

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 automatically detects your application’s framework and generates an optimized build configuration.

Supported Frameworks

Nixpacks supports 20+ languages and frameworks:
  • 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
Detection:
  • Django - Web framework
  • Flask - Microframework
  • FastAPI - Modern async framework
  • Streamlit - Data apps
Detection:
  • Standard Go - go.mod projects
  • Gin - Web framework
  • Echo - High performance
  • Fiber - Express-inspired
Detection:
  • Ruby on Rails - Full-stack framework
  • Sinatra - Lightweight framework
  • Hanami - Modern framework
Detection:
  • Laravel - Web framework
  • Symfony - Enterprise framework
  • WordPress - CMS
Detection:
  • Cargo projects - Standard Rust apps
  • Actix Web - High performance
  • Rocket - Web framework
Detection:
  • Spring Boot - Enterprise framework
  • Maven - Project management
  • Gradle - Build automation
Detection:

Configuration

How Nixpacks Works

1

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.)
2

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.)
3

Build Execution

Nixpacks executes the plan:
Nixpacks requires no configuration for most applications. It “just works” out of the box.

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:
Configure in Dokploy:

Build Arguments

Pass build-time variables to Docker build:
Configure in Dokploy:
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:
Directory structure:

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:
  1. Detect - Check for framework files
  2. Compile - Install dependencies and build
  3. Release - Generate start command
Example for Node.js:

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

1

Install Dependencies

2

Build Static Files

3

Serve with Nginx

SPA Mode

Enable for single-page applications:
This configures nginx to serve 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 secrets are not available in the final image or at runtime. Use environment variables for runtime secrets.

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

Symptoms: Module not found, package not installedSolutions:
  1. Verify dependency files are committed:
  2. Use appropriate install command:
  3. Enable clean cache:
Symptoms: Container exits immediately after startingSolutions:
  1. Check Dockerfile CMD/ENTRYPOINT:
  2. Verify build output location:
  3. Check application logs:
Symptoms: Builds take 10+ minutesSolutions:
  1. Optimize Dockerfile layer order
  2. Add .dockerignore file
  3. Use multi-stage builds
  4. Enable build cache:
  5. Use smaller base images:
Symptoms: No space left on deviceSolutions:
  1. Clean old images:
  2. Remove build cache:
  3. 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