solve permission problem
This commit is contained in:
31
Dockerfile
31
Dockerfile
@@ -51,17 +51,20 @@ ENV NEXT_TELEMETRY_DISABLED=1
|
||||
RUN addgroup --system --gid 1001 nodejs
|
||||
RUN adduser --system --uid 1001 nextjs
|
||||
|
||||
COPY --from=builder /app/node_modules ./node_modules
|
||||
COPY --from=builder /app/prisma ./prisma
|
||||
COPY --from=builder /app/.next/standalone ./
|
||||
COPY --from=builder /app/.next/static ./.next/static
|
||||
COPY --from=builder /app/public ./public
|
||||
COPY --from=builder /app/docker/entrypoint.sh ./docker/entrypoint.sh
|
||||
|
||||
RUN chmod +x ./docker/entrypoint.sh
|
||||
|
||||
USER nextjs
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
CMD ["./docker/entrypoint.sh"]
|
||||
COPY --from=builder /app/node_modules ./node_modules
|
||||
COPY --from=builder /app/prisma ./prisma
|
||||
COPY --from=builder /app/.next/standalone ./
|
||||
COPY --from=builder /app/.next/static ./.next/static
|
||||
COPY --from=builder /app/public ./public
|
||||
COPY --from=builder /app/docker/entrypoint.sh ./docker/entrypoint.sh
|
||||
|
||||
RUN chmod +x ./docker/entrypoint.sh
|
||||
|
||||
# --- NEU: Ordner erstellen und Rechte an den nextjs User geben ---
|
||||
RUN mkdir -p /app/.next/cache && chown nextjs:nodejs /app/.next/cache
|
||||
|
||||
USER nextjs
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
CMD ["./docker/entrypoint.sh"]
|
||||
|
||||
Reference in New Issue
Block a user