diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..14e27b8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,27 @@ +# Build stage +FROM node:22-alpine AS builder + +WORKDIR /app + +COPY . . +RUN npm install && npm run build + +# Production stage +FROM node:22-alpine AS runner + +WORKDIR /app + +ENV NODE_ENV=production + +RUN npm install next --save + +COPY --from=builder /app/.next/standalone ./ +COPY --from=builder /app/.next/static ./.next/static +COPY --from=builder /app/public ./public + +EXPOSE 3000 + +ENV PORT=3000 +ENV HOSTNAME="0.0.0.0" + +CMD ["npm", "start"] diff --git a/README.md b/README.md index daf2723..aab6f77 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,26 @@ By default, the dashboard reads config from `~/.openclaw/openclaw.json`. To use OPENCLAW_HOME=/opt/openclaw npm run dev ``` +## Docker Deployment + +You can also deploy the dashboard using Docker: + +### Build Docker Image + +```bash +docker build -t openclaw-dashboard . +``` + +### Run Container + +```bash +# Basic run +docker run -d -p 3000:3000 openclaw-dashboard + +# With custom OpenClaw config path +docker run -d --name openclaw-dashboard -p 3000:3000 -e OPENCLAW_HOME=/opt/openclaw -v /path/to/openclaw:/opt/openclaw openclaw-dashboard +``` + --- # OpenClaw Bot Dashboard(中文)