fix: use COPY --chown instead of recursive chown in Dockerfile
Avoids slow chown -R over node_modules (thousands of files).
This commit is contained in:
+5
-5
@@ -19,12 +19,12 @@ WORKDIR /app
|
||||
|
||||
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
|
||||
|
||||
COPY --from=build /app/build ./build
|
||||
COPY --from=build /app/node_modules ./node_modules
|
||||
COPY --from=build /app/package.json ./
|
||||
COPY --from=build /app/prisma ./prisma
|
||||
COPY --from=build --chown=appuser:appgroup /app/build ./build
|
||||
COPY --from=build --chown=appuser:appgroup /app/node_modules ./node_modules
|
||||
COPY --from=build --chown=appuser:appgroup /app/package.json ./
|
||||
COPY --from=build --chown=appuser:appgroup /app/prisma ./prisma
|
||||
|
||||
RUN mkdir -p /app/data && chown -R appuser:appgroup /app
|
||||
RUN mkdir -p /app/data && chown appuser:appgroup /app /app/data
|
||||
|
||||
USER appuser
|
||||
|
||||
|
||||
Reference in New Issue
Block a user