Skip to content

Commit 3808201

Browse files
committed
Dockerfile: keep /app owned by node:node
The node_modules and wwwroot directories are owned by root in the deployment image. Make sure they end up as owned by node:node like everything else under /app.
1 parent 20a64b4 commit 3808201

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ USER node
1919

2020
WORKDIR /app
2121

22-
COPY --from=build /app/wwwroot wwwroot
23-
COPY --from=build /app/node_modules node_modules
22+
# Without the chown when copying directories, wwwroot is owned by root:root.
23+
COPY --from=build --chown=node:node /app/wwwroot wwwroot
24+
COPY --from=build --chown=node:node /app/node_modules node_modules
2425
COPY --from=build /app/devserverconfig.json serverconfig.json
2526
COPY --from=build /app/index.js index.js
2627
COPY --from=build /app/package.json package.json

0 commit comments

Comments
 (0)