Ensure app files are owned by appuser#54
Merged
Conversation
Add `--chown=appuser:appuser` to COPY commands in runtime stage. Without explicit ownership, files inherit `root:root` with source permissions -- breaks when built with restrictive umask (027/077).
There was a problem hiding this comment.
Pull request overview
This PR ensures files copied into the runtime image are owned by the non-root appuser, preventing permission failures when source files (or copied artifacts) have restrictive modes (e.g., from umask 027/077) and the container runs as appuser.
Changes:
- Add
--chown=appuser:appusertoCOPYstatements in the runtime stage for the venv and app/config directories. - Keep
/datacreation and ownership aligned with the non-root runtime user.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
gkostkowski
approved these changes
Jul 16, 2026
There appear to be many files with CRLF line endings, but this particular one was problematic as it would be interpreted as modified by Git perpetually, for anyone who checks it out with no `autocrlf` setting. As a result, Git would forbid switching branches, and downstream tools will continue to interpret that there is a change. ```sh $ git ls-files --eol | grep rdf_mapping.yaml i/lf w/lf attr/text eol=lf src/config/rdf_mapping.yaml i/crlf w/crlf attr/text eol=lf test/resources/rdf_mapping.yaml ``` This is because the file was committed as CRLF despite there being an enforcement of UNIX EOL via `.gitattributes`. Both Git internal and working copies are CRLF in this case. The fix is to renormalize and commit the file: ```sh git add --renormalize . git commit -m "Normalize line endings" ``` And then reinitialize the local copy: ```sh rm test/resources/rdf_mapping.yaml git checkout HEAD -- test/resources/rdf_mapping.yaml ``` Verify that the Git-internal (`i`) and working copy (`w`; yours) are now correct: ```sh $ git ls-files --eol | grep rdf_mapping.yaml i/lf w/lf attr/text eol=lf src/config/rdf_mapping.yaml i/lf w/lf attr/text eol=lf test/resources/rdf_mapping.yaml ```
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add
--chown=appuser:appuserto COPY commands in runtime stage. Without explicit ownership, files inheritroot:rootwith source permissions -- breaks when built with restrictive umask (027/077).