Skip to content

Commit

Permalink
chore: update Dockerfile to adjust permissions for Rust directories a…
Browse files Browse the repository at this point in the history
…nd run application as root to avoid permission issues
  • Loading branch information
oceanbluesky committed Nov 22, 2024
1 parent e0c737b commit b30ebb5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ WORKDIR /usr/src/app

# Ensure all necessary directories are owned by `node`
RUN mkdir -p /root/.cargo /root/.rustup dist/assets/styles target /usr/src/app && \
chmod -R 775 /root/.cargo /root/.rustup && \
chown -R node:node /root/.cargo /root/.rustup dist target /usr/src/app

# Switch to non-root user for running the application
Expand All @@ -39,5 +40,6 @@ COPY . .
# Expose the port that the application listens on
EXPOSE 8080

# Run the application
# Run the application as root to avoid permission issues
USER root
CMD ["npm", "run", "serve"]

0 comments on commit b30ebb5

Please sign in to comment.