From dc69dec8de5c315f18d3d335b68ea59156c70465 Mon Sep 17 00:00:00 2001 From: Lio Date: Thu, 25 Jul 2024 21:15:33 +0200 Subject: [PATCH] move to config.yaml file again --- .dockerignore | 3 +-- Dockerfile | 11 ++--------- src/components/IndexSidebar.astro | 5 +++-- src/components/Sidebar.astro | 10 ++++++---- src/components/Social.astro | 4 +++- src/layouts/CharacterList.astro | 5 +++-- src/layouts/Gallery.astro | 5 +++-- src/layouts/Index.astro | 4 +++- 8 files changed, 24 insertions(+), 23 deletions(-) diff --git a/.dockerignore b/.dockerignore index 6c7dac1..a44058c 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,3 @@ .DS_Store node_modules -dist -config* \ No newline at end of file +dist \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 21b18b4..35bd26f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,7 @@ FROM node:lts AS base WORKDIR /app COPY package.json package-lock.json ./ +COPY config.yaml ./ FROM base AS prod-deps RUN npm ci --omit=dev @@ -13,20 +14,12 @@ FROM build-deps AS build COPY . . -ARG POCKETBASE_URL -ENV POCKETBASE_URL="${POCKETBASE_URL}" -ARG PUBLIC_DESCRIPTION -ENV PUBLIC_DESCRIPTION="${PUBLIC_DESCRIPTION}" -ARG PUBLIC_TITLE -ENV PUBLIC_TITLE="${PUBLIC_TITLE}" -ARG PUBLIC_USEICONS -ENV PUBLIC_USEICONS="${PUBLIC_USEICONS}" - RUN npm run build FROM base AS runtime COPY --from=prod-deps /app/node_modules ./node_modules COPY --from=build /app/dist ./dist +COPY --from=build /app/config.yaml ./config.yaml ARG PORT=4321 ENV HOST=0.0.0.0 diff --git a/src/components/IndexSidebar.astro b/src/components/IndexSidebar.astro index 8ed42f4..684452d 100644 --- a/src/components/IndexSidebar.astro +++ b/src/components/IndexSidebar.astro @@ -2,6 +2,7 @@ import { Image } from "astro:assets"; import Social from "./Social.astro"; import pb from "../lib/pb"; +import c from "../../config.yaml"; const avatarRec = await pb .collection("images") @@ -13,8 +14,8 @@ const socials = await pb.collection("socials").getFullList(); const config = { // icon, socials, - title: import.meta.env.PUBLIC_TITLE, - description: import.meta.env.PUBLIC_DESCRIPTION, + title: c.title, + description: c.description, }; --- diff --git a/src/components/Sidebar.astro b/src/components/Sidebar.astro index 4805dc1..ba18072 100644 --- a/src/components/Sidebar.astro +++ b/src/components/Sidebar.astro @@ -2,6 +2,8 @@ import { Image } from "astro:assets"; import Social from "./Social.astro"; import pb from "../lib/pb"; +import c from "../../config.yaml"; + const avatarRec = await pb .collection("images") @@ -12,15 +14,15 @@ const socials = await pb.collection("socials").getFullList(); const config = { icon, socials, - title: import.meta.env.PUBLIC_TITLE, - description: import.meta.env.PUBLIC_DESCRIPTION, + title: c.title, + description: c.description, }; ---