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
This commit is contained in:
renato97
2026-07-23 16:25:52 -03:00
parent 25449aa5df
commit 4e9f815a53
4 changed files with 58 additions and 11 deletions
+2 -4
View File
@@ -16,13 +16,11 @@ ENV NODE_ENV=production
RUN addgroup --system --gid 1001 nodejs && \
adduser --system --uid 1001 nextjs
RUN mkdir -p /app/data/covers && chown -R nextjs:nodejs /app/data
COPY --from=builder /app/public ./public
RUN mkdir .next
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static
COPY --from=builder /app/node_modules/better-sqlite3 ./node_modules/better-sqlite3
RUN mkdir -p /app/data/covers && chown -R nextjs:nodejs /app/data
USER nextjs
EXPOSE 3000