Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions examples/openui-chat/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# --------------------------------------------------
# Build stage: install dependencies and build app
# --------------------------------------------------
FROM node:20-alpine AS builder

WORKDIR /app

# Enable pnpm through corepack
RUN corepack enable

# Copy the whole repository
COPY . .

# Install dependencies
RUN pnpm install

# Build the OpenUI chat example
WORKDIR /app/examples/openui-chat
RUN pnpm build


# --------------------------------------------------
# Runtime stage: production container
# --------------------------------------------------
FROM node:20-alpine

WORKDIR /app

# Enable pnpm
RUN corepack enable

# Set production environment
ENV NODE_ENV=production

# Copy built app from builder
COPY --from=builder /app ./

# Switch to example directory
WORKDIR /app/examples/openui-chat

# Expose app port
EXPOSE 3000

# Start server
CMD ["pnpm","start"]
38 changes: 38 additions & 0 deletions examples/openui-chat/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,41 @@ To learn more about OpenUI, take a look at the following resources:

- [OpenUI Documentation](https://openui.com/docs) - learn about OpenUI features and API.
- [OpenUI GitHub repository](https://github.com/thesysdev/openui) - your feedback and contributions are welcome!

## Running with Docker

You can run the OpenUI chat example using Docker without manually installing dependencies.

### Build the container

```bash
docker build -t openui-chat .

```
### Run the container
```bash
docker run -p 3000:3000 -e OPENAI_API_KEY=sk-your-key openui-chat
```
After the container starts, open your browser and go to:

http://localhost:3000

The OpenUI chat example should now be running.

## Environment Variables

The following environment variables are supported:

| Variable | Description | Required |
|----------|-------------|----------|
| OPENAI_API_KEY | Your OpenAI API key used by the chat backend | Yes |
| OPENAI_MODEL | Optional model override (e.g. `gpt-4o`) | No |
| OPENAI_BASE_URL | Optional custom API endpoint | No |

Example:
```bash
docker run -p 3000:3000 \
-e OPENAI_API_KEY=sk-your-key \
-e OPENAI_MODEL=gpt-4o \
openui-chat
```