feat(docker): add site url as build argument

This commit is contained in:
Jewgeni Lewash 2024-02-26 13:36:35 +01:00
parent 0c245e48d6
commit 37d3e7029d
3 changed files with 8 additions and 2 deletions

View File

@ -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

View File

@ -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
```

View File

@ -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(),