From 839a86722b681d31d3e6a19cbe6939b37aefacdf Mon Sep 17 00:00:00 2001 From: Clemence Kyara Date: Thu, 10 Oct 2024 16:05:20 +0300 Subject: [PATCH] Subpath imports requires package.json --- Dockerfile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 143cc9bd3..f8b072f99 100644 --- a/Dockerfile +++ b/Dockerfile @@ -403,9 +403,13 @@ ENV NEXT_PUBLIC_APP_LOGO_URL=${NEXT_PUBLIC_APP_LOGO_URL} \ RUN set -ex \ # Create nextjs cache dir w/ correct permissions - && mkdir -p ./apps/civicsignalblog//.next \ + && mkdir -p ./apps/civicsignalblog/.next \ && chown nextjs:nodejs ./apps/civicsignalblog/.next +# Node +# Subpath imports definitions +COPY --from=civicsignalblog-builder --chown=nextjs:nodejs /workspace/apps/civicsignalblog/package.json ./apps/civicsignalblog/package.json + # PNPM # symlink some dependencies COPY --from=civicsignalblog-builder --chown=nextjs:nodejs /workspace/node_modules ./node_modules @@ -424,8 +428,8 @@ COPY --from=civicsignalblog-builder --chown=nextjs:nodejs /workspace/apps/civics COPY --from=civicsignalblog-builder --chown=nextjs:nodejs /workspace/apps/civicsignalblog/.next ./apps/civicsignalblog/.next # Payload -COPY --from=civicsignalblog-builder /workspace/apps/civicsignalblog/dist ./apps/civicsignalblog/dist -COPY --from=civicsignalblog-builder /workspace/apps/civicsignalblog/build ./apps/civicsignalblog/build +COPY --from=civicsignalblog-builder --chown=nextjs:nodejs /workspace/apps/civicsignalblog/dist ./apps/civicsignalblog/dist +COPY --from=civicsignalblog-builder --chown=nextjs:nodejs /workspace/apps/civicsignalblog/build ./apps/civicsignalblog/build # Since we can't use output: "standalone", switch to specific app's folder WORKDIR /workspace/apps/civicsignalblog