Skip to content

feat: add Dockerfile for openui-chat example#363

Closed
zlplzp123wyt wants to merge 1 commit intothesysdev:mainfrom
zlplzp123wyt:feat/docker-image-chat
Closed

feat: add Dockerfile for openui-chat example#363
zlplzp123wyt wants to merge 1 commit intothesysdev:mainfrom
zlplzp123wyt:feat/docker-image-chat

Conversation

@zlplzp123wyt
Copy link
Copy Markdown

Fixes #303

Summary

Add a production-ready Dockerfile for the openui-chat example so users can build and run it with a single command:

docker build -t openui-chat .
docker run -p 3000:3000 -e OPENAI_API_KEY=sk-... openui-chat

Changes

  • Dockerfile: Multi-stage build (builder + runner) that handles the pnpm monorepo workspace dependencies, builds the CLI + workspace packages, generates the system prompt, and produces a minimal production image
  • next.config.ts: Enable output: "standalone" for efficient Docker builds
  • .dockerignore: Exclude node_modules, .next, .git from build context

Architecture

The Dockerfile uses a two-stage approach:

  1. Builder: Installs workspace deps, builds all required packages (@openuidev/cli, @openuidev/react-ui, @openuidev/react-headless, @openuidev/react-lang), generates the system prompt, and builds the Next.js app in standalone mode
  2. Runner: Copies only the standalone output + static assets into a minimal Node.js image, runs as non-root user

Environment Variables

Variable Description Required
OPENAI_API_KEY OpenAI API key for LLM calls Yes
PORT Server port (default: 3000) No
HOSTNAME Server hostname (default: 0.0.0.0) No

Add a production-ready Dockerfile for the openui-chat example app so
users can build and run it with a single command:

  docker build -t openui-chat .
  docker run -p 3000:3000 -e OPENAI_API_KEY=sk-... openui-chat

Changes:
- Add Dockerfile with multi-stage build (builder + runner)
- Enable Next.js standalone output in next.config.ts
- Add .dockerignore at repo root
- Support configuration via OPENAI_API_KEY env var

Fixes thesysdev#303

Signed-off-by: zlplzp123wyt <3955904069@qq.com>
@zahlekhan
Copy link
Copy Markdown
Contributor

Thanks for your contribution. Your PR review is on hold since we have already assigned the issue to another contributor.
#305

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docker image for chat

2 participants