feat: deploy adapter for Docker#320
Merged
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
react-server-docs | e5ee7c6 | Mar 01 2026, 08:24 PM |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a new built-in Docker deploy adapter for
@lazarv/react-serverthat generates production-ready Docker images from your application build output. The adapter supports three container runtimes — Node.js, Bun, and Deno — configurable via a singleruntimeoption.Motivation
While existing adapters target managed platforms (Vercel, Netlify, Cloudflare, AWS, Azure), many teams need to deploy to their own infrastructure or any environment that runs Docker containers (Kubernetes, ECS, Fly.io, Railway, self-hosted servers, etc.). This adapter bridges that gap by generating a minimal, single-stage Dockerfile with pre-built application output — no build step happens inside Docker, resulting in smaller images and faster builds.
What's included
Runtime support
node:<version>-alpineoven/bun:<version>Bun.serve()static routesdenoland/deno:<version>Deno.serve()with file readsAdapter options
runtime"node"|"bun"|"deno""node"namestringpackage.jsontagstring"<name>:latest"portnumber3000versionstring"20-alpine"/"alpine"Usage
Output structure
The adapter generates a
.docker/directory containing everything needed to build the image:Node.js:
Bun / Deno:
Bug fixes in dependency resolution
During development and testing, several issues were discovered and fixed in the core dependency resolution that affected Docker (and potentially other Node-mode adapters):
dependencies.mjs: All eagerrequire.resolve()calls now use atryResolve()helper that returnsundefinedon failure instead of throwing. This prevents build crashes when optional peer dependencies (e.g.,react/compiler-runtime,react-dom/client) are not installed.module-alias.mjs: SametryResolve()pattern applied, withundefinedaliases filtered out before returning the alias map.core.mjs: Added missing runtime dependencies to the NFT trace list (module-alias,unstorage,unstorage/drivers/*,picocolors, and Node runtime startup files). Fixed the alias include block to use pre-resolved paths instead of re-resolving keys, which failed in pnpm workspace setups.Documentation