fix: create env placeholder file inline in Dockerfile for dynamic public env
Some checks failed
Build and Push Docker Image to Gitea / build-and-push (push) Failing after 4m6s

.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 <noreply@anthropic.com>
This commit is contained in:
2026-03-04 17:09:42 +01:00
parent 865787fb45
commit 1e69d0b158

View File

@@ -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