-
Notifications
You must be signed in to change notification settings - Fork 2
Setup frontend production container to run as non-privileged user #115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'll look into this. |
Thanks. I have a draft version that runs on openshift in my own fork: master...tfrisk:openshift-deployment |
Would this do the trick https://github.com/salabs/Epimetheus/compare/develop...feature/docker_services_run_nonroot ? |
Tested with that branch. Container failed to start:
|
That's odd. If I build container locally with command |
I'm running it on our OpenShift cluster, https://research.csc.fi/en/-/rahti OpenShift is known to have more strict requirements over plain docker/kubernetes as it's targeted for more enterprise use. My own fork I linked in previous comment works fine. It uses a bit dumber approach to build the frontend container. |
I updated the branch and moved the log files back to their orginal locations under the /var/log directory. I hope that this works because next step would be that the nginx is started by the root, not nginx user. |
It works now, awesome! Thanks Ville. These changes together with removing extra exit() from backend_server (discussed here: #114) makes working openshift combo. |
These changes have merged to master branch yesterday so closing this issue. |
Is your feature request related to a problem? Please describe.
OpenShift platform requires containers to run as non-privileged users. In practice that means containers cannot have root access. This means file access to root filesystem is read-only and privileged network ports (below 1024) should not be used. Current Dockerfile-prod setup does not work with OpenShift without modifications.
Describe the solution you'd like
For production docker image, use non-privileged port (for example 8080) and adjust nginx pid+temp file paths to /tmp.
Describe alternatives you've considered
Alternatively you can provide openshift-specific production dockerfile for frontend container.
Additional context
I can provide base config and test the deployment in openshift cluster.
The text was updated successfully, but these errors were encountered: