Detection
migetpacks detects Deno when any of these files are present in your project root:deno.jsondeno.jsoncdeno.lock
Deno detection takes priority over Node.js. If both
deno.json and package.json exist, migetpacks will detect Deno as the primary language.Version Detection
Deno version is resolved in this order:| Priority | Source | Example |
|---|---|---|
| 1 | DENO_VERSION env var | DENO_VERSION=2.0 |
| 2 | .deno-version file | 2.6.1 |
| 3 | .dvmrc file | 2.6.1 |
| 4 | version field in deno.json | "2.6.1" |
| 5 | Default | 2.6.1 |
Build Process
migetpacks generates a Dockerfile that caches dependencies separately from source code:Entry Point Detection
The entry point is automatically detected in this order:starttask indeno.json(extracts the.ts/.jsfile from the command)- Common file patterns:
main.ts,mod.ts,server.ts,app.ts,index.ts,index.js,main.js,src/main.ts,src/mod.ts - Falls back to
main.ts
Dependency Caching
Ifdeno.json contains an imports field, deno install is run in a separate layer before source code is copied. This ensures dependencies are cached when only source code changes.
Run Command
The default run command is determined in this order:| Priority | Source | Command |
|---|---|---|
| 1 | RUN_COMMAND env var | User-specified |
| 2 | web: in Procfile | From Procfile |
| 3 | Default | deno run --allow-net --allow-read --allow-env {entrypoint} |
Caching
Docker Layer Caching
Dependencies are installed fromdeno.json in a separate layer. The deno cache command pre-compiles the entry point and its dependencies, which are stored in DENO_DIR inside the build directory.
Registry Cache
UseCACHE_IMAGE to push/pull BuildKit inline cache layers to a registry for cross-build caching.
Deno does not use BuildKit cache mounts since dependency caching is handled through the
DENO_DIR environment variable and Docker layer caching.DHI Support
Deno is supported with Docker Hardened Images (requires version 2.6.4 or later).
| Stage | Image |
|---|---|
| Build | dhi.io/deno:{version}-dev |
| Runtime | dhi.io/deno:{version} |
deno user (non-root) and is distroless with no shell.