Skip to content

fix: Security: Containerized Frontend application is running as root#1373

Merged
mpawlow merged 1 commit intorelease-saas-0.1from
mp/fix/saas/GH-1320-frontend-app-running-as-root
Apr 13, 2026
Merged

fix: Security: Containerized Frontend application is running as root#1373
mpawlow merged 1 commit intorelease-saas-0.1from
mp/fix/saas/GH-1320-frontend-app-running-as-root

Conversation

@mpawlow
Copy link
Copy Markdown
Collaborator

@mpawlow mpawlow commented Apr 10, 2026

Issue

Reference Pull Request

Summary

  • Fixed the frontend Docker container running as root by switching to the built-in non-root node user for all build and runtime steps.

Security: Run frontend container as non-root user

  • Added chown node:node /app after WORKDIR so the working directory is owned by the non-root user before the user switch.
  • Added USER node directive to switch to the non-root node user for all subsequent Dockerfile instructions.
  • Updated COPY instructions to use --chown=node:node so copied files are owned by the node user rather than root.
  • Removed trailing whitespace from npm run build line.
  • Added missing newline at end of file.

Issue

- #1320

Summary

- Fixed the frontend Docker container running as root by switching to the built-in non-root `node` user for all build and runtime steps.

Security: Run frontend container as non-root user

- Added `chown node:node /app` after `WORKDIR` so the working directory is owned by the non-root user before the user switch.
- Added `USER node` directive to switch to the non-root `node` user for all subsequent Dockerfile instructions.
- Updated `COPY` instructions to use `--chown=node:node` so copied files are owned by the `node` user rather than root.
- Removed trailing whitespace from `npm run build` line.
- Added missing newline at end of file.
@mpawlow mpawlow self-assigned this Apr 10, 2026
@github-actions github-actions bot added docker bug 🔴 Something isn't working. labels Apr 10, 2026
@github-actions github-actions bot added bug 🔴 Something isn't working. and removed bug 🔴 Something isn't working. labels Apr 10, 2026
@mpawlow mpawlow requested a review from lucaseduoli April 13, 2026 16:35
Copy link
Copy Markdown
Collaborator

@lucaseduoli lucaseduoli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-actions github-actions bot added the lgtm label Apr 13, 2026
@mpawlow mpawlow merged commit b4142d2 into release-saas-0.1 Apr 13, 2026
10 checks passed
@github-actions github-actions bot deleted the mp/fix/saas/GH-1320-frontend-app-running-as-root branch April 13, 2026 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug 🔴 Something isn't working. docker lgtm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants