From 63a5674c0bdd47aad71fcf68977fe0b8120bc774 Mon Sep 17 00:00:00 2001 From: Wuesteon Date: Mon, 8 Dec 2025 16:15:42 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20add=20build=20args=20for?= =?UTF-8?q?=20SvelteKit=20env=20vars=20in=20web=20Dockerfiles?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SvelteKit apps using $env/static/public require environment variables at build time. Added ARG/ENV directives with defaults for Docker builds. --- apps/calendar/apps/web/Dockerfile | 8 ++++++++ apps/chat/apps/web/Dockerfile | 8 ++++++++ apps/clock/apps/web/Dockerfile | 8 ++++++++ apps/manacore/apps/web/Dockerfile | 6 ++++++ apps/todo/apps/web/Dockerfile | 8 ++++++++ 5 files changed, 38 insertions(+) diff --git a/apps/calendar/apps/web/Dockerfile b/apps/calendar/apps/web/Dockerfile index 04040c048..94132a760 100644 --- a/apps/calendar/apps/web/Dockerfile +++ b/apps/calendar/apps/web/Dockerfile @@ -1,6 +1,14 @@ # Build stage FROM node:20-alpine AS builder +# Build arguments for SvelteKit static env vars +ARG PUBLIC_BACKEND_URL=http://calendar-backend:3016 +ARG PUBLIC_MANA_CORE_AUTH_URL=http://mana-core-auth:3001 + +# Set as environment variables for build +ENV PUBLIC_BACKEND_URL=$PUBLIC_BACKEND_URL +ENV PUBLIC_MANA_CORE_AUTH_URL=$PUBLIC_MANA_CORE_AUTH_URL + # Install pnpm RUN corepack enable && corepack prepare pnpm@9.15.0 --activate diff --git a/apps/chat/apps/web/Dockerfile b/apps/chat/apps/web/Dockerfile index e6200335f..cd19de658 100644 --- a/apps/chat/apps/web/Dockerfile +++ b/apps/chat/apps/web/Dockerfile @@ -1,6 +1,14 @@ # Build stage FROM node:20-alpine AS builder +# Build arguments for SvelteKit static env vars +ARG PUBLIC_BACKEND_URL=http://chat-backend:3002 +ARG PUBLIC_MANA_CORE_AUTH_URL=http://mana-core-auth:3001 + +# Set as environment variables for build +ENV PUBLIC_BACKEND_URL=$PUBLIC_BACKEND_URL +ENV PUBLIC_MANA_CORE_AUTH_URL=$PUBLIC_MANA_CORE_AUTH_URL + # Install pnpm RUN corepack enable && corepack prepare pnpm@9.15.0 --activate diff --git a/apps/clock/apps/web/Dockerfile b/apps/clock/apps/web/Dockerfile index 8b9baf360..10e51fa63 100644 --- a/apps/clock/apps/web/Dockerfile +++ b/apps/clock/apps/web/Dockerfile @@ -1,6 +1,14 @@ # Build stage FROM node:20-alpine AS builder +# Build arguments for SvelteKit static env vars +ARG PUBLIC_BACKEND_URL=http://clock-backend:3017 +ARG PUBLIC_MANA_CORE_AUTH_URL=http://mana-core-auth:3001 + +# Set as environment variables for build +ENV PUBLIC_BACKEND_URL=$PUBLIC_BACKEND_URL +ENV PUBLIC_MANA_CORE_AUTH_URL=$PUBLIC_MANA_CORE_AUTH_URL + # Install pnpm RUN corepack enable && corepack prepare pnpm@9.15.0 --activate diff --git a/apps/manacore/apps/web/Dockerfile b/apps/manacore/apps/web/Dockerfile index 7fb03759d..3310a6326 100644 --- a/apps/manacore/apps/web/Dockerfile +++ b/apps/manacore/apps/web/Dockerfile @@ -1,6 +1,12 @@ # Build stage FROM node:20-alpine AS builder +# Build arguments for SvelteKit static env vars +ARG PUBLIC_MANA_CORE_AUTH_URL=http://mana-core-auth:3001 + +# Set as environment variables for build +ENV PUBLIC_MANA_CORE_AUTH_URL=$PUBLIC_MANA_CORE_AUTH_URL + # Install pnpm RUN corepack enable && corepack prepare pnpm@9.15.0 --activate diff --git a/apps/todo/apps/web/Dockerfile b/apps/todo/apps/web/Dockerfile index 6d15865e6..740d41725 100644 --- a/apps/todo/apps/web/Dockerfile +++ b/apps/todo/apps/web/Dockerfile @@ -1,6 +1,14 @@ # Build stage FROM node:20-alpine AS builder +# Build arguments for SvelteKit static env vars +ARG PUBLIC_BACKEND_URL=http://todo-backend:3018 +ARG PUBLIC_MANA_CORE_AUTH_URL=http://mana-core-auth:3001 + +# Set as environment variables for build +ENV PUBLIC_BACKEND_URL=$PUBLIC_BACKEND_URL +ENV PUBLIC_MANA_CORE_AUTH_URL=$PUBLIC_MANA_CORE_AUTH_URL + # Install pnpm RUN corepack enable && corepack prepare pnpm@9.15.0 --activate