mirror of
https://github.com/rennf93/roboco.git
synced 2026-08-03 07:23:24 +02:00
fix(panel): chown public assets to nextjs so they don't 500
The panel image copied /app/public without --chown, leaving every asset root:root rwxrwx---. The container runs as the non-root nextjs user (uid 1001), which falls under 'other' (no perms) → EACCES reading any public file → Next.js returns 500 for /roboco-logo.png and friends. A redeploy never helped because the image itself baked in the bad ownership. Chown the public copy to nextjs:nodejs, matching the standalone/static copies.
This commit is contained in:
@@ -55,8 +55,11 @@ ENV NODE_ENV=production
|
||||
RUN addgroup --system --gid 1001 nodejs
|
||||
RUN adduser --system --uid 1001 nextjs
|
||||
|
||||
# Copy public assets
|
||||
COPY --from=builder /app/public ./public
|
||||
# Copy public assets. Must be chowned to the runtime user (nextjs) like the
|
||||
# standalone/static copies below — without it the assets stay root:root
|
||||
# rwxrwx--- and the non-root nextjs process gets EACCES serving them, so every
|
||||
# /public file (e.g. roboco-logo.png) 500s.
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/public ./public
|
||||
|
||||
# Copy standalone build
|
||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
|
||||
|
||||
Reference in New Issue
Block a user