Build Type
Learn about the different build types available in Dokploy, including Nixpacks, Dockerfile, and Buildpack options.
Dokploy offers three distinct build types for deploying applications, each suited to different development needs and preferences.
Nixpacks
This is the default build type in Dokploy. When you select Nixpacks, Dokploy builds your application as a Nixpack, which is optimized for ease of use and efficiency.
Nixpacks expose multiples variables to be configured via environment variables. All of these variables are prefixed with NIXPACKS_
, you can define them in the Environment Variables
tab.
Variable | Description |
---|---|
NIXPACKS_INSTALL_CMD | Override the install command to use |
NIXPACKS_BUILD_CMD | Override the build command to use |
NIXPACKS_START_CMD | Override command to run when starting the container |
NIXPACKS_PKGS | Add additional Nix packages to install |
NIXPACKS_APT_PKGS | Add additional Apt packages to install (comma delimited) |
NIXPACKS_LIBS | Add additional Nix libraries to make available |
NIXPACKS_INSTALL_CACHE_DIRS | Add additional directories to cache during the install phase |
NIXPACKS_BUILD_CACHE_DIRS | Add additional directories to cache during the build phase |
NIXPACKS_NO_CACHE | Disable caching for the build |
NIXPACKS_CONFIG_FILE | Location of the Nixpacks configuration file relative to the root of the app |
NIXPACKS_DEBIAN | Enable Debian base image, used for supporting OpenSSL 1.1 |
If you need more manage about nixpacks process, you can create a nixpacks.toml
file in the root of your application you can read here Nixpacks Configuration.
Nixpacks support monorepo such as NX Monorepo, Turborepo, Moon Repo, you can read more about it here.
You can read more about Nixpacks here.
Since Nixpacks have a static builder Dokploy expose a field called Publish Directory
where basically you can specify
the directory that you want to publish after the build process is finished, example:
Astro applications after you build it usually create a dist
directory, so you can specify the dist
directory as the publish directory and then Dokploy will
copy all the files in the dist
directory to the root of your application, and will use a NGINX Optimized Dockerfile to run your application.
Railpack (NEW)
Railpack is a new build type optimized and is the successor of Nixpacks.
Railpack exposes multiple Build Variables, you can define them in the Environment Variables
tab.
Name | Description |
---|---|
BUILD_CMD | Set the command to run for the build step. This overwrites any commands that come from providers |
START_CMD | Set the command to run when the container starts |
PACKAGES | Install additional Mise packages. In the format pkg@version . The latest version is used if not provided. |
BUILD_APT_PACKAGES | Install additional Apt packages during build |
DEPLOY_APT_PACKAGES | Install additional Apt packages in the final image |
you can read more about Railpack here.
Railpack supports Nodejs, Python, Go, PHP, Go, StaticFile, Shell Scripts.
Dockerfile
If your project includes a Dockerfile, you can specify its path. Dokploy will use this Dockerfile to build your application directly, giving you full control over the build environment and dependencies
Dokploy expose 3 Fields to be configured:
Dockerfile Path (Required)
: The path to the Dockerfile to use for building the application, eg. If your Dockerfile is in the root of your application you can just specify theDockerfile
file.Docker Context Path
: This is where the Dockerfile is located, eg. If your Dockerfile is in the root of your application you can just specify the.
(dot) character, is basically to tell docker what context will use to build your application, you can read Dockerfile Context for more information.Docker Build Stage
: This is the build stage to use for building the application, eg. If you want to use thebuilder
stage you can specify thebuilder
stage, read more about build stages here.
Buildpack
Dokploy supports two types of buildpacks:
- Heroku: Adapted from Heroku's popular cloud platform, these buildpacks are designed for compatibility and ease of migration, you can optional specify the Heroku Version to use, by default Dokploy will use the 24.
- Paketo: Provides cloud-native buildpacks that leverage modern standards and practices for building applications.
By choosing the appropriate build type, you can tailor the deployment process to best fit your application's requirements and your operational preferences.
Static
Static build type is used to server static applications, it will use a NGINX Optimized Dockerfile to run your application.
Dokploy will copy everything from the Root
directory and will mount it to the /usr/share/nginx/html
directory, and will use a NGINX Optimized Dockerfile to run your application.
Recomendations
- For prototyping and development purposes, we recommend using the
Nixpacks
build type. - For production purposes, we recommend follow this Production Guide to have a rock solid deployment.
- For static applications, we recommend using the
Static
build type.