From 03e60c8e7e3c788ed873783243791012a72be967 Mon Sep 17 00:00:00 2001 From: afterlifepro Date: Sun, 17 Aug 2025 23:23:49 +0100 Subject: [PATCH] Resolve issues w container. namely: - pnpm is just latest forever - install packages not just fetch - add the user properly - host the server so its visible on lan which means docker can publish the port --- Dockerfile | 9 +++++---- astro.config.mjs | 6 +++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4f592a9..fa51022 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,17 +4,18 @@ WORKDIR /app # install pnpm ENV PNPM_HOME="/pnpm" ENV PATH="$PNPM_HOME:$PATH" -RUN corepack enable pnpm && corepack install -g pnpm@latest-10 +RUN corepack enable pnpm && corepack install -g pnpm@latest # copy whole project, install packages, and build COPY . ./ -RUN pnpm fetch --prod -RUN pnpm exec astro build +RUN pnpm install --prod +RUN pnpm run build EXPOSE 4321 # set a user so the container doesnt run as root -RUN useradd app +# no pword/home +RUN adduser -DH app USER app CMD ["node", "./dist/server/entry.mjs"] \ No newline at end of file diff --git a/astro.config.mjs b/astro.config.mjs index 39b88df..bef0a95 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -15,6 +15,10 @@ export default defineConfig({ mode: "standalone", }), + server: { + host: true, + }, + env: { schema: { SPOTIFY_CLIENT_ID: envField.string({ @@ -32,4 +36,4 @@ export default defineConfig({ }), }, }, -}); \ No newline at end of file +}); -- 2.51.2