Files
worst-scan-web/Dockerfile
T
renato97 4e9f815a53 fix: standalone start script copies static files automatically
- scripts/start.js: copies .next/static to .next/standalone/.next/static
  before launching the standalone server (prevents CSS 404)
- package.json: start script now uses scripts/start.js
- Dockerfile: removed fragile manual better-sqlite3 copy
  (already included in standalone output)
- scripts/setup.sh: added local prod option for npm start
2026-07-23 16:25:52 -03:00

35 lines
789 B
Docker

FROM node:22-alpine AS deps
WORKDIR /app
RUN apk add --no-cache python3 make g++
COPY package.json package-lock.json ./
RUN npm ci
FROM node:22-alpine AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN npm run build
FROM node:22-alpine AS runner
WORKDIR /app
ENV NODE_ENV=production
RUN addgroup --system --gid 1001 nodejs && \
adduser --system --uid 1001 nextjs
COPY --from=builder /app/public ./public
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static
RUN mkdir -p /app/data/covers && chown -R nextjs:nodejs /app/data
USER nextjs
EXPOSE 3000
ENV PORT=3000
ENV HOSTNAME=0.0.0.0
ENV DB_PATH=/app/data/worst-scan.db
ENV COVERS_DIR=/app/data/covers
VOLUME ["/app/data"]
CMD ["node", "server.js"]