Build packs

Choose how OnePloy builds your application. Railpack, Nixpacks, Static, Dockerfile and Docker Compose build packs compared, with when to use each.

A build pack decides how OnePloy turns your source code into a container image. Pick Railpack or Nixpacks for automatic detection, Dockerfile when you control the image, Docker Compose for multi-container apps, and Static for plain HTML or prebuilt assets.

Which build pack should I choose?

Build packBest forWhat you provide
RailpackMost web apps in common languages, with zero configurationSource code. Commands are detected and can be overridden.
NixpacksSame use case as Railpack, using Nixpacks detectionSource code. Commands are detected and can be overridden.
StaticPlain HTML, CSS and JavaScript, or already-built assetsA directory of files to serve.
DockerfileFull control over the imageA Dockerfile in the repository.
Docker ComposeSeveral containers deployed together from GitA Compose file in the repository.

If you do not need a build at all, add a Docker Image resource instead and point it at an image in any registry.

Railpack and Nixpacks

Both analyse the repository, detect the language and framework, and generate an image. You can override the detected behaviour in the application’s general settings:

  • Install command, Build command and Start command
  • Base directory for monorepos, so only a subfolder is built
  • Ports exposes, the port your app listens on

How do I deploy a static site with Railpack or Nixpacks?

Set Site type to Static (or SPA for single-page apps that need client-side routing) and set the Publish directory, for example dist or build. OnePloy runs your build and serves the output with an nginx:alpine web server.

Static

Use the Static build pack when the repository already contains the files to serve. Set the base directory and publish directory, and OnePloy serves them with nginx:alpine. You can generate a default nginx configuration for static or SPA routing from the settings page.

Dockerfile

OnePloy builds the Dockerfile found at the Dockerfile location (default is the repository root). You can also set a Docker build stage target for multi-stage builds, and pass build arguments through build-time environment variables.

To build from a Dockerfile without a repository, add a Dockerfile resource and paste the file contents.

Docker Compose

OnePloy reads the Compose file at the Docker compose location and deploys every service in it. Domains are assigned per service on the Domains page. See Custom Docker Compose for the variables OnePloy injects into Compose files.

Can I change the build pack later?

Yes. Change it in the application’s general settings and redeploy. Check the ports and commands afterwards, because each build pack uses different defaults.

Tip: If a build is slow, check that Build cache is enabled in the advanced settings, and use Watch paths so pushes that only touch unrelated folders do not trigger a deployment.

Last updated