change production docker
continuous-integration/drone/push Build is passing

This commit is contained in:
2026-04-10 21:21:17 +01:00
parent 50ef8326dd
commit d20fff0f19
+5 -7
View File
@@ -56,24 +56,22 @@ WORKDIR /app
ENV NODE_ENV=production ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1 ENV NEXT_TELEMETRY_DISABLED=1
# Create non-root user
RUN addgroup --system --gid 1001 nodejs \ RUN addgroup --system --gid 1001 nodejs \
&& adduser --system --uid 1001 nextjs && adduser --system --uid 1001 nextjs
# Copy built output # Copy standalone build and static files
COPY --from=builder /app/public ./public COPY --from=builder /app/public ./public
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./ COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
# ✅ FIX: ensure Next.js cache directory exists and is writable # 1. Create the specific cache directory Next.js is looking for
RUN mkdir -p /app/.next/cache \ # 2. Give ownership to the 'nextjs' user
&& chown -R nextjs:nodejs /app/.next RUN mkdir -p /app/.next/cache/images && chown -R nextjs:nodejs /app/.next
USER nextjs USER nextjs
EXPOSE 3000
ENV PORT=3000 ENV PORT=3000
ENV HOSTNAME=0.0.0.0 ENV HOSTNAME=0.0.0.0
EXPOSE 3000
CMD ["node", "server.js"] CMD ["node", "server.js"]