docs/latest/deployment/deno-compile.md
You can create a self-contained executable out of your app with the
deno compile command.
It will include all assets and dependencies. This executable can run on any
platform without requiring Deno to be installed.
# Build your app first
deno task build
# Generate self-contained executable
deno compile --output my-app --include _fresh -A _fresh/compiled-entry.js
The --include _fresh flag ensures that all built assets (JavaScript bundles,
CSS, static files) are embedded in the binary.
The compiled entry supports two environment variables out of the box:
PORT to set the port number (PORT=4000 ./my-app)HOSTNAME to set the host name (HOSTNAME=0.0.0.0 ./my-app)You can compile for a different platform using the --target flag:
deno compile --target x86_64-unknown-linux-gnu --output my-app --include _fresh -A _fresh/compiled-entry.js
See the
deno compile documentation
for a full list of supported targets.