Revert "Setup non-root user within Dockerfile. Copy files as non-root user within Dockerfile. Launch app as non-root user within Dockerfile"

This reverts commit 4b2e4ce93a.
This commit is contained in:
Glenn de Haan
2024-10-04 12:40:44 +02:00
parent 990608be1c
commit b0a520d4a3

View File

@@ -103,26 +103,15 @@ HEALTHCHECK --interval=10s --timeout=3s \
CMD ["dumb-init", "node", "/app/server.js"]
#
# Setup non-root user
# Bundle app
#
RUN addgroup -g 1000 node \
&& adduser -u 1000 -G node -s /bin/sh -D node;
# Bundle from build image
COPY --from=dependencies /app/node_modules ./node_modules
COPY --from=css /app/public/dist ./public/dist
COPY . .
#
# Set build
#
RUN echo -n `date '+%Y.%m.%d.%H.%M'` > /etc/unifi_voucher_site_build
#
# Continue as non-root user
#
USER node
#
# Bundle app
#
# Bundle from build image
COPY --chown=node:node --from=dependencies /app/node_modules ./node_modules
COPY --chown=node:node --from=css /app/public/dist ./public/dist
COPY --chown=node:node . .