From 427129de199a897a0e77b5c14a448ffddf925725 Mon Sep 17 00:00:00 2001 From: June Date: Mon, 17 Nov 2025 18:57:42 +1300 Subject: [PATCH] docker is now working using the worst workaround known to man.... i will fix this codebase one day probably --- web/Dockerfile | 2 +- web/src/pages/index.astro | 2 +- web/src/pages/recipe/[id]/index.astro | 2 +- web/src/pages/tags/[tag].astro | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/web/Dockerfile b/web/Dockerfile index c2755cc..fa77efe 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -3,7 +3,7 @@ WORKDIR /app COPY package*.json ./ RUN npm i COPY . . -ENV PUBLIC_PB_URL=http://pb:8080 +ENV PUBLIC_PB_URL="http://pb:8090" ENV PUBLIC_URL=http://localhost:4321 RUN npm run build diff --git a/web/src/pages/index.astro b/web/src/pages/index.astro index 9008b23..a2622a3 100644 --- a/web/src/pages/index.astro +++ b/web/src/pages/index.astro @@ -11,7 +11,7 @@ const records = await pb.collection('recipes').getFullList() const recipes = records.map(r => new Recipe(r.cooklang)) const ids = records.map(r => r.id) const images = await Promise.all( - records.map(r => pb.files.getURL(r, r.images[0]).substring(21)) // get first image from each recipe as a cover image + records.map(r => '/api' + pb.files.getURL(r, r.images[0]).split('api')[1] ) // get first image from each recipe as a cover image ) --- diff --git a/web/src/pages/recipe/[id]/index.astro b/web/src/pages/recipe/[id]/index.astro index 4f96c76..a87c31e 100644 --- a/web/src/pages/recipe/[id]/index.astro +++ b/web/src/pages/recipe/[id]/index.astro @@ -16,7 +16,7 @@ const re = await pb.collection('recipes').getOne(id as string) let recipeData = new Recipe(re.cooklang) const images = await Promise.all( - re.images.map(r => pb.files.getURL(re, r).substring(21)) + re.images.map(r => '/api' + pb.files.getURL(re, r).split('api')[1]) ) --- diff --git a/web/src/pages/tags/[tag].astro b/web/src/pages/tags/[tag].astro index d09fa03..07e5f67 100644 --- a/web/src/pages/tags/[tag].astro +++ b/web/src/pages/tags/[tag].astro @@ -14,7 +14,7 @@ const records = await pb.collection('recipes').getFullList({ const recipes = records.map(r => new Recipe(r.cooklang)) const ids = records.map(r => r.id) const images = await Promise.all( - records.map(r => pb.files.getURL(r, r.images[0]).substring(21)) // get first image from each recipe as a cover image + records.map(r => '/api' + pb.files.getURL(r, r.images[0]).split('api')[1]) // get first image from each recipe as a cover image ) ---