From 91c4047afd0e04e470182e092ed72b432d9f984a Mon Sep 17 00:00:00 2001 From: Pratapa Lakshmi Date: Tue, 17 Jun 2025 12:47:00 +0530 Subject: [PATCH 1/3] refactor: optimize Dockerfile for web and space applications by refining COPY commands for static assets --- space/Dockerfile.space | 10 +++++----- web/Dockerfile.web | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/space/Dockerfile.space b/space/Dockerfile.space index ecb3fbec7..680903814 100644 --- a/space/Dockerfile.space +++ b/space/Dockerfile.space @@ -56,10 +56,10 @@ WORKDIR /app COPY --from=installer /app/space/next.config.js . COPY --from=installer /app/space/package.json . -COPY --from=installer /app/space/.next/standalone ./ - -COPY --from=installer /app/space/.next ./space/.next -COPY --from=installer /app/space/public ./space/public +# Only bring in what's needed for standalone runtime +COPY --from=installer /app/space/.next/standalone ./ +COPY --from=installer /app/space/.next/static ./.next/static +COPY --from=installer /app/space/public ./public ARG NEXT_PUBLIC_API_BASE_URL="" ENV NEXT_PUBLIC_API_BASE_URL=$NEXT_PUBLIC_API_BASE_URL @@ -82,4 +82,4 @@ ENV NEXT_PUBLIC_WEB_BASE_URL=$NEXT_PUBLIC_WEB_BASE_URL ENV NEXT_TELEMETRY_DISABLED 1 ENV TURBO_TELEMETRY_DISABLED 1 -EXPOSE 3000 +EXPOSE 3000 \ No newline at end of file diff --git a/web/Dockerfile.web b/web/Dockerfile.web index 56f931adc..ab36fb9f1 100644 --- a/web/Dockerfile.web +++ b/web/Dockerfile.web @@ -73,7 +73,7 @@ COPY --from=installer /app/web/package.json . # Automatically leverage output traces to reduce image size # https://nextjs.org/docs/advanced-features/output-file-tracing COPY --from=installer /app/web/.next/standalone ./ -COPY --from=installer /app/web/.next ./web/.next +COPY --from=installer /app/web/.next/static ./web/.next/static COPY --from=installer /app/web/public ./web/public ARG NEXT_PUBLIC_API_BASE_URL="" @@ -103,4 +103,4 @@ ENV NEXT_PUBLIC_WEB_BASE_URL=$NEXT_PUBLIC_WEB_BASE_URL ENV NEXT_TELEMETRY_DISABLED 1 ENV TURBO_TELEMETRY_DISABLED 1 -EXPOSE 3000 +EXPOSE 3000 \ No newline at end of file From 6fd448ddace1250df27e514714d5ec9b0cdbab8e Mon Sep 17 00:00:00 2001 From: Pratapa Lakshmi Date: Tue, 17 Jun 2025 15:15:26 +0530 Subject: [PATCH 2/3] refactor: update Dockerfile for space and web applications to correct asset paths and improve structure --- space/Dockerfile.space | 4 ++-- web/Dockerfile.web | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/space/Dockerfile.space b/space/Dockerfile.space index 680903814..a52f84f71 100644 --- a/space/Dockerfile.space +++ b/space/Dockerfile.space @@ -56,10 +56,10 @@ WORKDIR /app COPY --from=installer /app/space/next.config.js . COPY --from=installer /app/space/package.json . -# Only bring in what's needed for standalone runtime COPY --from=installer /app/space/.next/standalone ./ + COPY --from=installer /app/space/.next/static ./.next/static -COPY --from=installer /app/space/public ./public +COPY --from=installer /app/space/public ./space/public ARG NEXT_PUBLIC_API_BASE_URL="" ENV NEXT_PUBLIC_API_BASE_URL=$NEXT_PUBLIC_API_BASE_URL diff --git a/web/Dockerfile.web b/web/Dockerfile.web index ab36fb9f1..037f552c8 100644 --- a/web/Dockerfile.web +++ b/web/Dockerfile.web @@ -73,6 +73,7 @@ COPY --from=installer /app/web/package.json . # Automatically leverage output traces to reduce image size # https://nextjs.org/docs/advanced-features/output-file-tracing COPY --from=installer /app/web/.next/standalone ./ + COPY --from=installer /app/web/.next/static ./web/.next/static COPY --from=installer /app/web/public ./web/public From 59a682f6d9de214ac7399060907f3187378c46e4 Mon Sep 17 00:00:00 2001 From: Pratapa Lakshmi Date: Tue, 17 Jun 2025 15:58:43 +0530 Subject: [PATCH 3/3] fix: update Dockerfile for space application to correct static asset path --- space/Dockerfile.space | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/space/Dockerfile.space b/space/Dockerfile.space index a52f84f71..03a2b317f 100644 --- a/space/Dockerfile.space +++ b/space/Dockerfile.space @@ -58,7 +58,7 @@ COPY --from=installer /app/space/package.json . COPY --from=installer /app/space/.next/standalone ./ -COPY --from=installer /app/space/.next/static ./.next/static +COPY --from=installer /app/space/.next/static ./space/.next/static COPY --from=installer /app/space/public ./space/public ARG NEXT_PUBLIC_API_BASE_URL=""