diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..e8b85189 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,33 @@ +# Claw3D — 3D agent visualization for OpenClaw +# Multi-stage build: install deps → build Next.js → run with custom server + +FROM node:20-slim AS deps +WORKDIR /app +COPY package.json package-lock.json ./ +RUN npm ci --ignore-scripts + +FROM node:20-slim AS builder +WORKDIR /app +COPY --from=deps /app/node_modules ./node_modules +COPY . . +ENV NEXT_TELEMETRY_DISABLED=1 +# Build-time gateway URL (overridden at runtime by CLAW3D_GATEWAY_URL) +ENV NEXT_PUBLIC_GATEWAY_URL=ws://localhost:18789 +RUN npm run build + +FROM node:20-slim AS runner +WORKDIR /app +ENV NODE_ENV=production +ENV NEXT_TELEMETRY_DISABLED=1 + +# Copy built app + custom server + node_modules +COPY --from=builder /app/.next ./.next +COPY --from=builder /app/public ./public +COPY --from=builder /app/server ./server +COPY --from=builder /app/node_modules ./node_modules +COPY --from=builder /app/package.json ./package.json +COPY --from=builder /app/next.config.ts ./next.config.ts + +EXPOSE 3000 + +CMD ["node", "server/index.js"]