diff --git a/Dockerfile b/Dockerfile index f691fed..309e9a9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,6 +14,10 @@ RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile FROM build-deps AS build COPY . . + +ARG SITE_URL +ENV SITE_URL=${SITE_URL} + RUN pnpm run build FROM nginx:alpine AS runtime diff --git a/Readme.md b/Readme.md index a606822..4c84637 100644 --- a/Readme.md +++ b/Readme.md @@ -42,7 +42,7 @@ pnpm dev Production Build: ```sh -sudo docker build -t astro-deploy . +sudo docker build . --build-arg SITE_URL=https://example.com -t astro-deploy docker run -d -p 1234:80 astro-deploy ``` diff --git a/astro.config.mjs b/astro.config.mjs index f651a5d..4ac052e 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -3,9 +3,11 @@ import react from '@astrojs/react'; import sitemap from '@astrojs/sitemap'; import tailwind from '@astrojs/tailwind'; +const SITE_URL = process.env.SITE_URL || 'https://astro.deployn.de'; + // https://astro.build/config export default defineConfig({ - site: 'https://astro.deployn.de', + site: SITE_URL, integrations: [ react(), sitemap(),