From 1e69d0b1581295eb1cec00cf06abc839d7610678 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Kr=C3=BCger?= Date: Wed, 4 Mar 2026 17:09:42 +0100 Subject: [PATCH] fix: create env placeholder file inline in Dockerfile for dynamic public env .dockerignore excludes .env files so the previous COPY failed silently. $env/dynamic/public requires variable names to be declared at build time to generate named exports; empty placeholders satisfy this while actual values still come from process.env at runtime. Co-Authored-By: Claude Sonnet 4.6 --- Dockerfile | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 65215fc..8de053a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,9 +14,10 @@ WORKDIR /app # Copy workspace configuration COPY pnpm-workspace.yaml package.json pnpm-lock.yaml ./ -# Copy .env to .env.production for proper svelte compiling -RUN mkdir -p ./packages/frontend -COPY packages/frontend/.env ./packages/frontend/.env.production +# Create env file with placeholder values so SvelteKit knows variable names at build time +# Actual values are injected at runtime via process.env (adapter-node) +RUN mkdir -p ./packages/frontend && \ + printf 'PUBLIC_API_URL=\nPUBLIC_URL=\nPUBLIC_UMAMI_ID=\nPUBLIC_UMAMI_SCRIPT=\n' > ./packages/frontend/.env # ============================================================================ # Builder stage - compile application with Rust/WASM support