mirror of
https://github.com/PeterMaquiran/tvone.git
synced 2026-04-18 07:17:52 +00:00
This commit is contained in:
+5
-7
@@ -56,24 +56,22 @@ WORKDIR /app
|
||||
ENV NODE_ENV=production
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
|
||||
# Create non-root user
|
||||
RUN addgroup --system --gid 1001 nodejs \
|
||||
&& adduser --system --uid 1001 nextjs
|
||||
|
||||
# Copy built output
|
||||
# Copy standalone build and static files
|
||||
COPY --from=builder /app/public ./public
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
|
||||
|
||||
# ✅ FIX: ensure Next.js cache directory exists and is writable
|
||||
RUN mkdir -p /app/.next/cache \
|
||||
&& chown -R nextjs:nodejs /app/.next
|
||||
# 1. Create the specific cache directory Next.js is looking for
|
||||
# 2. Give ownership to the 'nextjs' user
|
||||
RUN mkdir -p /app/.next/cache/images && chown -R nextjs:nodejs /app/.next
|
||||
|
||||
USER nextjs
|
||||
|
||||
EXPOSE 3000
|
||||
ENV PORT=3000
|
||||
ENV HOSTNAME=0.0.0.0
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
CMD ["node", "server.js"]
|
||||
Reference in New Issue
Block a user