diff --git a/Dockerfile b/Dockerfile index ee28bfa..30634d7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,8 +23,8 @@ COPY --from=deps --chown=nextjs:nodejs /app/node_modules ./node_modules # Remove yarn.lock so nothing accidentally invokes yarn RUN rm -f yarn.lock -# Ensure data dir is writable at runtime -RUN mkdir -p /app/data && chown -R nextjs:nodejs /app/data && chmod 755 /app/data +# Give nextjs user ownership of the entire workdir (WORKDIR creates it as root) +RUN chown -R nextjs:nodejs /app # Build the app at image build time (not at container start) USER nextjs