mirror of
https://github.com/xmanrui/OpenClaw-bot-review.git
synced 2026-07-27 21:30:23 +00:00
- Enable Next.js standalone output for smaller image size - Remove unnecessary npm install in production stage - Use direct node execution instead of npm start - Add .dockerignore to exclude unnecessary files from build context
27 lines
434 B
Docker
27 lines
434 B
Docker
# 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
|
|
|
|
# Copy standalone output
|
|
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 ["node", "server.js"]
|