Skip to content
neatploy.
Build & deploy

Variables and build secrets

Variables are scoped to a single service and environment. You can add variables individually as key/value pairs or paste an entire .env file in the dashboard.

Every deployment stores an encrypted snapshot (AES-256-GCM) of the exact variables it used, so rolling back to an earlier deployment restores both its image and its original configuration. Changes are staged in the Deploy bar until you click Deploy.

Secrets during builds

All variables are available during runtime, and secret variables reach Docker builds as BuildKit secret mounts. They are not passed as ARG build arguments, preventing secrets from leaking into image layers or history.

A Dockerfile must explicitly mount a secret when a build step needs it:

RUN --mount=type=secret,id=NAME \
    your-command --token-file /run/secrets/NAME

Replace NAME and the command with your own secret name and build step. Avoid copying /run/secrets/NAME into the filesystem layer or echoing its contents in build logs. Non-secret variables are supplied as build arguments.

Automatic database injection

Adding a managed PostgreSQL, MySQL, MongoDB, or Redis service automatically injects its connection string (DATABASE_URL, MYSQL_URL, MONGO_URL, REDIS_URL) and engine-specific variables into application services in the same environment. If multiple databases of the same kind exist in an environment, use service links in the dashboard to specify which database to bind.