specific.hcl
Configuration
One of the following is required (mutually exclusive):base- base environment:"node","python","go","rust", or"java". For anything else, use a custom Dockerfile.dockerfile- path to a custom Dockerfile, relative tospecific.hcl.
command- build command to run after dependencies are installed (for example,npm run buildorgo build -o api). Only valid withbase, not withdockerfile.root- working directory for build commands, relative tospecific.hcl. Defaults to".". Sets theWORKDIRin the generated Dockerfile; services that reference this build inherit its root, and dependency detection looks here.context- Docker build context scope, relative tospecific.hcl. Defaults to".". Controls what files are available toCOPYand what’s included in the deployment tarball.env- environment variables available during the build, passed as Docker build args. See Build-time environment variables.
Automatic dependency installation
Specific detects your dependency manager (from the lockfile) and installs dependencies before running your build command. Installs are cached, so rebuilds are fast when only source code changes. For projects that only need dependencies installed, omitcommand:
specific.hcl
specific docs builds for the exact per-base detection and install behavior.
Build-time environment variables
Useenv to pass variables during the build step. This is useful for frameworks like Next.js that inline environment variables at build time.
specific.hcl
- String literals (for example,
"production"). service.<name>.public_url- the public domain of another service.- String interpolation with
${service.<name>.public_url}.
public_url doesn’t include a scheme, use interpolation to compose full URLs. Other references (secrets, config, databases) are not available at build time.
Monorepos
Useroot to set where build commands run. This applies to both the build command and dependency detection:
specific.hcl
root vs context
The two are orthogonal:
root= where commands run (working directory).context= what files are available (Docker build context / tarball scope).
context is the specific.hcl directory. Set it only to widen the scope, for example to include shared libraries in a parent directory:
specific.hcl
Custom Dockerfile
For full control over the build, provide your own Dockerfile instead ofbase:
specific.hcl
commandis not allowed - define build steps in the Dockerfile itself.contextstill controls the Docker build context.envvars are passed as Docker build args; consume them withARGinstructions.- The service
commandstill overrides the containerCMDat runtime.
specific.hcl
Dockerfile
Local development
Thedev block overrides the build command during specific dev. If no dev block is defined, the build is skipped in development; most dev servers (like npm run dev) handle building themselves.
specific.hcl
dev block is almost always needed; without it, no binary is produced locally. Use a tool that rebuilds on file changes:
specific.hcl
Production
Duringspecific deploy, builds run in the cloud in parallel, after a local test run catches errors early. See Deployments for the full pipeline.