From 47d9464ad40d891b1195d6a912241434c58ff24f Mon Sep 17 00:00:00 2001 From: Michess Date: Mon, 13 Apr 2026 11:36:47 +0200 Subject: [PATCH] fix: NEXT_PUBLIC_* URLs als Docker Build-Args weitergereicht --- Dockerfile | 6 ++++++ docker-compose.yml | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 5c10f55..19f752e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,6 +14,12 @@ RUN corepack enable && \ pnpm config set store-dir /opt/michess/.pnpm-store && \ pnpm install --no-frozen-lockfile +# Build-time env vars for Next.js (baked into the frontend bundle) +ARG NEXT_PUBLIC_API_URL=http://localhost:3001 +ARG NEXT_PUBLIC_APP_URL=http://localhost:3000 +ENV NEXT_PUBLIC_API_URL=$NEXT_PUBLIC_API_URL +ENV NEXT_PUBLIC_APP_URL=$NEXT_PUBLIC_APP_URL + # Build server and client RUN pnpm build:server && pnpm build:client diff --git a/docker-compose.yml b/docker-compose.yml index 5274476..423f39c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,10 @@ services: michess: - build: . + build: + context: . + args: + NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL:-http://localhost:3001} + NEXT_PUBLIC_APP_URL: ${NEXT_PUBLIC_APP_URL:-http://localhost:3000} image: michess:latest container_name: michess restart: unless-stopped