Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Deno 7 min read How-to mediumAdept

Run npm and Deno anywhere

Deno apps, including those using npm specifiers, can be containerized with the official denoland/deno Docker image and deployed to any VPS or container platform, not just Deno Deploy. A shared Oak-based main.ts, Dockerfile and docker-compose.yml are built locally, then pushed and run on AWS Lightsail via Docker Hub, on a Digital Ocean Droplet via its container registry and docker run, and on Google Cloud Run via Artifact Registry and gcloud run deploy. npm specifiers were not yet supported on Deno Deploy at the time.

Assumes: Docker basicsDeno basics

Related posts

  • Manage your Deno Deploy and Deno Subhosting projects with Terraform

    Deno mediumAdept

    Deno now ships an official Terraform provider (denoland/deno) for managing Deno Deploy and Deno Subhosting projects, custom domains and deployments as infrastructure-as-code. A walkthrough deploys a local TypeScript server with a static asset: configure the provider with an organization ID and token (or DENO_DEPLOY_ORGANIZATION_ID/DENO_DEPLOY_TOKEN env vars), create a deno_project, collect files via the deno_assets data source with a root path and glob pattern, then define a deno_deployment with an entry point and env vars. Running terraform plan and apply creates the resources, and terraform state show reveals the deployment's deno.dev URL. The provider is pitched as simpler than calling the Subhosting API directly when coordinating hundreds of projects.

  • Build a dinosaur runner game with Deno, pt. 1

    Deno mediumAdept

    Part one of a series building a browser dinosaur runner game sets up a Deno project that serves static files and deploys it. It covers `deno init`, adding the Oak framework from JSR, defining `dev` and `start` tasks in deno.json with explicit `--allow-net`/`--allow-read`/`--env-file` permissions, and a minimal Oak server that serves `public/` via `context.send`. It also adds an `/api` router with a health check endpoint, then deploys with `deno deploy` using `src/main.ts` as the entry point.

  • Introducing deployctl, the command line interface for Deno Deploy

    Deno mediumAdept

    deployctl is a CLI for managing the full lifecycle of Deno Deploy projects from the terminal: deploying, renaming projects, inspecting deployments, streaming logs, monitoring resource usage with `deployctl top`, promoting preview deployments to production, and deleting deployments or projects. The walkthrough deploys a Hono server and saves its config in deno.json. Because deployments are immutable, changing env vars, domains or the KV database means creating a new deployment, and `redeploy --prod` reuses an existing build to promote it. Piped output is JSON, which makes the CLI scriptable for CI/CD.

  • Deno 1.34: deno compile supports npm packages

    Deno mediumAdept

    Deno 1.34 lets `deno compile` bundle npm packages and their dependencies into a single self-contained executable. That makes tools like vite and eslint shippable as binaries with pinned dependencies, and they tend to start faster than running from a local cache. The release also adds cross-platform glob support in deno.json, deno task and CLI flags, and TLS certificates with IP addresses via rustls. Smaller changes include a top-level `exclude` and `nodeModulesDir` in config, configurable language-server limits, a `Deno.serve()` signature change that returns a `Deno.Server`, new `createHttpClient` pool options, more Node.js polyfills, and upgrades to V8 11.5 and TypeScript 5.0.4.

  • Build and Ship Astro Sites with Deno and Deno Deploy

    Deno mediumAdept

    Astro sites can be built with the Deno runtime and hosted on Deno Deploy in two modes. Static output from `npm run build` is served via the Deno standard library file server and auto-deployed from GitHub Actions. Server-rendered apps use Astro's `output: "server"` mode with a Deno adapter, a generated `server/entry.mjs` entrypoint, and npm scripts rewritten to run Astro through `deno run -A --unstable npm:astro`. A template app shows SSR form handling in component scripts, client-side delete calls to an API route, and data persistence that can be switched to Deno KV.

The quest for software engineering knowledge.

Look:
Layout: