From 4701eedc3b7e421cb8809d70d97979fba0b47736 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sun, 20 Feb 2022 11:56:26 +0000 Subject: [PATCH] Revert "Add group and user in dockerfile to run container as unprivileged" --- Dockerfile | 26 +++++--------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/Dockerfile b/Dockerfile index e785e88788..ebb6f41ca9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,32 +30,16 @@ FROM node:16.13.2-alpine # Define some ENV Vars ENV PORT=80 \ DIRECTORY=/app \ - IS_DOCKER=true \ - USER=docker \ - UID=12345 \ - GID=23456 - -# Install tini for initialization and tzdata for setting timezone -RUN apk add --no-cache tzdata tini \ - # Add group - && addgroup --gid ${GID} "${USER}" \ - # Add user - && adduser \ - --disabled-password \ - --ingroup "${USER}" \ - --gecos "" \ - --home "${DIRECTORY}" \ - --no-create-home \ - --uid "$UID" \ - "$USER" - -USER ${USER} + IS_DOCKER=true # Create and set the working directory WORKDIR ${DIRECTORY} +# Install tini for initialization and tzdata for setting timezone +RUN apk add --no-cache tzdata tini + # Copy built application from build phase -COPY --from=BUILD_IMAGE --chown=${USER}:${USER} /app ./ +COPY --from=BUILD_IMAGE /app ./ # Finally, run start command to serve up the built application ENTRYPOINT [ "/sbin/tini", "--" ]