Files
goodpackagerepo/frontend/Dockerfile
copilot-swe-agent[bot] aae989ec29 Implement RocksDB with HTTP endpoints and fix Docker build
- Replace in-memory KV store with RocksDB persistent storage
- Add RocksDB wrapper class with stats tracking
- Create HTTP endpoints: /rocksdb/stats, /rocksdb/keys, /rocksdb/dashboard
- Add interactive HTML dashboard for monitoring RocksDB
- Fix frontend Dockerfile to handle missing public directory

Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
2025-12-29 09:50:41 +00:00

52 lines
1.1 KiB
Docker

FROM node:18-alpine AS base
# Install dependencies only when needed
FROM base AS deps
RUN apk add --no-cache libc6-compat
WORKDIR /app
COPY package.json package-lock.json* ./
RUN npm ci
# Rebuild the source code only when needed
FROM base AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
ENV NEXT_TELEMETRY_DISABLED=1
# Ensure public directory exists (Next.js may not create it if no static assets)
RUN mkdir -p public
RUN npm run build
# Production image, copy all the files and run next
FROM base AS runner
WORKDIR /app
ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
COPY --from=builder /app/public ./public
# Set the correct permission for prerender cache
RUN mkdir .next
RUN chown nextjs:nodejs .next
# Automatically leverage output traces to reduce image size
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
USER nextjs
EXPOSE 3000
ENV PORT=3000
ENV HOSTNAME="0.0.0.0"
CMD ["node", "server.js"]