From e69443ea2ef6860e82012b6b01031d57c622804b Mon Sep 17 00:00:00 2001 From: Adrian Altner Date: Wed, 22 Apr 2026 17:16:38 +0200 Subject: [PATCH] refactor: switch to nginx for serving static files and remove Node.js dependencies --- Containerfile | 20 ++++---------------- astro.config.mjs | 6 ------ 2 files changed, 4 insertions(+), 22 deletions(-) diff --git a/Containerfile b/Containerfile index 06e85f9..0966204 100644 --- a/Containerfile +++ b/Containerfile @@ -14,22 +14,10 @@ COPY . . RUN npm run build -FROM node:22-bookworm-slim AS runtime +FROM nginx:alpine AS runtime -WORKDIR /app +COPY --from=build /app/dist /usr/share/nginx/html -ENV NODE_ENV=production -ENV ASTRO_TELEMETRY_DISABLED=1 -ENV HOST=0.0.0.0 -ENV PORT=4321 +EXPOSE 80 -COPY --from=build --chown=node:node /app/package.json ./package.json -COPY --from=build --chown=node:node /app/package-lock.json ./package-lock.json -COPY --from=build --chown=node:node /app/node_modules ./node_modules -COPY --from=build --chown=node:node /app/dist ./dist - -USER node - -EXPOSE 4321 - -CMD ["node", "dist/server/entry.mjs"] +CMD ["nginx", "-g", "daemon off;"] diff --git a/astro.config.mjs b/astro.config.mjs index 27c9723..19737cf 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -5,8 +5,6 @@ import sitemap from '@astrojs/sitemap'; import { defineConfig, fontProviders } from 'astro/config'; import { loadEnv } from 'vite'; -import node from '@astrojs/node'; - const envMode = process.env.NODE_ENV === 'production' ? 'production' : 'development'; const envVars = loadEnv(envMode, process.cwd(), ''); const WEBMENTION_TOKEN = envVars.WEBMENTION_TOKEN || process.env.WEBMENTION_TOKEN || ''; @@ -68,8 +66,4 @@ export default defineConfig({ }, }, ], - - adapter: node({ - mode: 'standalone', - }), }); \ No newline at end of file