Skip to content

Commit 47bd02e

Browse files
committed
Extend read/write to nonroot.
Used with file upload.
1 parent 8a914b6 commit 47bd02e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

app/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,13 +120,14 @@ LABEL "org.opencontainers.image.description"="Simple Node.js express application
120120
LABEL "org.opencontainers.image.source"=https://github.com/${GITHUB_ACCOUNT}/${GITHUB_REPOSITORY}
121121
LABEL "org.nodejs.version"=${NODE_VERSION}
122122

123-
COPY --from=builder /opt/ngsi-tutorial /opt/ngsi-tutorial
123+
COPY --from=builder --chown=nonroot:nonroot /opt/ngsi-tutorial /opt/ngsi-tutorial
124124
WORKDIR /opt/ngsi-tutorial
125125

126126
USER nobody
127127
ENV NODE_ENV=production
128128
# Ports used by application
129129
EXPOSE ${WEB_APP_PORT:-3000}
130+
USER nonroot
130131
CMD ["./bin/www"]
131132
HEALTHCHECK --interval=30s --timeout=3s --start-period=10s \
132133
CMD ["/nodejs/bin/node", "./bin/healthcheck"]

0 commit comments

Comments
 (0)