From 6af75088af5ee499c12b5beedc0c4e7434e0c240 Mon Sep 17 00:00:00 2001 From: Ahmed Al-Taiar Date: Wed, 10 Dec 2025 12:46:29 -0500 Subject: [PATCH] Fix EACCES on /app/package.json in Docker --- Dockerfile | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index e1a1c91..e5e30a8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,8 @@ ENV NEXT_PUBLIC_APP_VERSION=$APP_VERSION WORKDIR /app -RUN corepack enable && corepack prepare yarn@4.9.1 --activate +RUN corepack enable +RUN corepack prepare yarn@4.12.0 --activate COPY package.json yarn.lock .yarnrc.yml ./ RUN yarn install --immutable @@ -22,9 +23,10 @@ LABEL org.opencontainers.image.version=$APP_VERSION WORKDIR /app -RUN corepack enable && corepack prepare yarn@4.9.1 --activate \ - && addgroup -S nodejs -g 1001 \ - && adduser -S nextjs -u 1001 +RUN corepack enable +RUN corepack prepare yarn@4.12.0 --activate +RUN addgroup -S nodejs -g 1001 +RUN adduser -S nextjs -u 1001 COPY --from=builder /app/yarn.lock ./yarn.lock COPY --from=builder /app/.yarnrc.yml ./.yarnrc.yml @@ -33,8 +35,8 @@ COPY --from=builder /app/public ./public COPY --from=builder /app/node_modules ./node_modules COPY --from=builder /app/package.json ./package.json -RUN mkdir -p /app/.yarn && chown -R nextjs:nodejs /app/.yarn -RUN mkdir -p /app/.next/cache/images && chown -R nextjs:nodejs /app/.next/cache/images +RUN mkdir -p /app/.yarn /app/.next/cache/images +RUN chown -R nextjs:nodejs /app USER nextjs EXPOSE 3000