From 82cc1f0ed8356e4215ec7c83c2d286d803480cfe Mon Sep 17 00:00:00 2001 From: Henit Chobisa Date: Tue, 22 Aug 2023 09:14:44 +0000 Subject: [PATCH] fix: Plane-App not taking correct env for plane-deploy url --- apps/app/Dockerfile.web | 3 ++- apps/space/Dockerfile.space | 8 ++------ nginx/nginx.conf.template | 5 ++++- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/apps/app/Dockerfile.web b/apps/app/Dockerfile.web index 2b28e1fd1..bedd6558f 100644 --- a/apps/app/Dockerfile.web +++ b/apps/app/Dockerfile.web @@ -55,7 +55,8 @@ COPY --from=installer --chown=captain:plane /app/apps/app/.next ./apps/app/.next ARG NEXT_PUBLIC_API_BASE_URL=http://localhost:8000 ENV NEXT_PUBLIC_API_BASE_URL=$NEXT_PUBLIC_API_BASE_URL \ - BUILT_NEXT_PUBLIC_API_BASE_URL=$NEXT_PUBLIC_API_BASE_URL + BUILT_NEXT_PUBLIC_API_BASE_URL=$NEXT_PUBLIC_API_BASE_URL \ + NEXT_PUBLIC_DEPLOY_URL=$NEXT_PUBLIC_DEPLOY_URL USER root COPY replace-env-vars.sh /usr/local/bin/ diff --git a/apps/space/Dockerfile.space b/apps/space/Dockerfile.space index 0240ddbf7..884a32ce5 100644 --- a/apps/space/Dockerfile.space +++ b/apps/space/Dockerfile.space @@ -51,7 +51,7 @@ COPY --from=installer /app/apps/space/package.json . # https://nextjs.org/docs/advanced-features/output-file-tracing COPY --from=installer --chown=captain:plane /app/apps/space/.next/standalone ./ -COPY --from=installer --chown=captain:plane /app/apps/space/.next ./apps/space/.next +COPY --from=installer --chown=captain:plane /app/apps/space/.next/static ./apps/space/.next/static ARG NEXT_PUBLIC_API_BASE_URL=http://localhost:8000 ENV NEXT_PUBLIC_API_BASE_URL=$NEXT_PUBLIC_API_BASE_URL \ @@ -62,9 +62,5 @@ COPY replace-env-vars.sh /usr/local/bin/ COPY start.sh /usr/local/bin/ RUN chmod +x /usr/local/bin/replace-env-vars.sh RUN chmod +x /usr/local/bin/start.sh - USER captain - -ENV NEXT_TELEMETRY_DISABLED 1 - -EXPOSE 3000 +ENV NEXT_TELEMETRY_DISABLED 1 \ No newline at end of file diff --git a/nginx/nginx.conf.template b/nginx/nginx.conf.template index 796c9e10d..ee21c97e5 100644 --- a/nginx/nginx.conf.template +++ b/nginx/nginx.conf.template @@ -16,7 +16,10 @@ server { } location /spaces/ { - proxy_pass http://planedeploy:3000/; + rewrite ^/spaces/(.*)$ /$1 break; + proxy_pass http://planedeploy:4000/; + sub_filter 'http://localhost/_next/static/' 'http://localhost/spaces/_next/static/'; + sub_filter_once off; } location /api/ {