<p></p>
<p><code>bundle install</code> also needs to deploy a few gems in a fresh install, so I would assume this is relevant here as well.</p>
<p>In a quick test drive, I created a non-root user with uid 1000 right before:</p>
<pre><code># Setup app location
RUN mkdir -p /app
</code></pre>
<p>(uid 1000 matches my Ubuntu user id)</p>
<p>Then I  changed the ownership of that /app directory to the new user using chown, followed by <code>USER xyz</code>.<br>
<code>bundle install</code> and <code>yarn install</code> would then run as non-root, and that seemed to work ok.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/openstreetmap/openstreetmap-website/pull/2409#issuecomment-746451046">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AAK2OLOSLJEB7AEUQHKN67LSVDFDRANCNFSM4JDURRXA">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AAK2OLIVH65S7NCQ4D3SNYDSVDFDRA5CNFSM4JDURRXKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOFR67AZQ.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/openstreetmap-website/pull/2409#issuecomment-746451046",
"url": "https://github.com/openstreetmap/openstreetmap-website/pull/2409#issuecomment-746451046",
"name": "View Pull Request"
},
"description": "View this Pull Request on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>