Skip to content
This repository has been archived by the owner on Aug 14, 2024. It is now read-only.

Run container as user(nginx) with limited permissions #81

Merged
merged 2 commits into from
Sep 29, 2023

Conversation

Andilun
Copy link
Contributor

@Andilun Andilun commented Sep 29, 2023

This adjustment closely resembles the changes described in the Medium article below. The only difference is that we need to grant the nginx user r+w access to '/usr/share/nginx/html/__ENV.js' because it is change at runtime. Without it we get this error when starting the container:

react-env: Writing runtime env ///usr/share/nginx/html/__ENV.js
node:internal/fs/utils:350
    throw err;
    ^

Error: EACCES: permission denied, open '///usr/share/nginx/html/__ENV.js'

This should resolve issue#78

Reference

@sonarcloud
Copy link

sonarcloud bot commented Sep 29, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@bjornandre bjornandre self-requested a review September 29, 2023 13:54
Copy link
Contributor

@bjornandre bjornandre left a comment

Choose a reason for hiding this comment

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

LGTM. Nice work :)

@Andilun Andilun merged commit e50ff64 into master Sep 29, 2023
6 checks passed
@Andilun Andilun deleted the run-container-as-non-root branch September 29, 2023 13:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Container runs as root user
2 participants