Skip to content

Commit

Permalink
Clean up permissions
Browse files Browse the repository at this point in the history
Other attempts have failed to remove the permissions
  • Loading branch information
BronzBierd committed Jan 21, 2025
1 parent 0b7de1f commit 6cef507
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions docker/web/Dockerfile.release
Original file line number Diff line number Diff line change
Expand Up @@ -73,22 +73,17 @@ USER root
WORKDIR /opt/app-root/src

# Copy package.json and package-lock.json
COPY ${WEB_SRC}/package*.json .
COPY --chmod=674 ${WEB_SRC}/package*.json .

# Fix file permissisons for Github agent(REMOVE WHEN MIGRATING TO VUE3)
RUN chmod -R 674 ./

# Switch from root to 104 to install package (REMOVE WHEN MIGRATING TO VUE3)
# NPM INSTALL fails as root, this is due to a legacy SCSS package, this is not required in VUE3 (REMOVE WHEN UPGRADING)
USER 104
# Install packages
RUN npm install ${NPM_INSTALL_ARGS}
# NPM INSTALL fails as root, this is due to a legacy SCSS package, this is not required in VUE3 (REMOVE WHEN UPGRADING)
USER root

# Copy the source code
COPY ${WEB_SRC} .

# Fix permissisons from installing with user 104 (REMOVE WHEN MIGRATING TO VUE3)
RUN chmod -R 674 ./
COPY --chmod=674 ${WEB_SRC} .

RUN npm run build

Expand All @@ -107,8 +102,8 @@ COPY ${VUE_ON_NGINX_SRC}/s2i/bin/fix-base-url /usr/libexec/s2i/fix-base-url

# Fix permissions.
USER root
RUN chmod 674 /usr/libexec/s2i/fix-base-url
RUN chmod -R 674 /tmp/app/dist/
RUN chmod u+rw,g+rwx,o+r /usr/libexec/s2i/fix-base-url
RUN chmod -R u+rw,g+rwx,o+r /tmp/app/dist/

# From nginx-runtime.
USER 104
Expand All @@ -117,4 +112,4 @@ USER 104
# short circuit the s2i lifecycle.
# The runtime image "loses" its s2i runtime voodoo when it
# is used in a dockerStrategy, which is why the explicit `CMD` is necessary
CMD /usr/libexec/s2i/fix-base-url
CMD ["/usr/libexec/s2i/fix-base-url"]

0 comments on commit 6cef507

Please sign in to comment.