- Integrate @astrojs/sitemap for automatic sitemap generation - Add robots.txt with sitemap reference - Add Open Graph and Twitter Card meta tags to Layout - Add canonical URL and structured data slot to Layout - Add JSON-LD schema (WebSite, CollectionPage, Book, BreadcrumbList) - Create custom 404 page with navigation links - Create default OG image (SVG with graph-paper theme) - Wire SITE_URL through Docker build args for production builds - Update Caddyfile for proper 404 handling instead of SPA fallback
36 lines
895 B
Docker
36 lines
895 B
Docker
# Build stage
|
|
FROM ghcr.io/astral-sh/uv:python3.11-bookworm-slim AS base
|
|
WORKDIR /app
|
|
|
|
# Install Node.js
|
|
RUN apt-get update && apt-get install -y curl && \
|
|
curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
|
|
apt-get install -y nodejs && \
|
|
apt-get clean && rm -rf /var/lib/apt/lists/*
|
|
|
|
# Development target
|
|
FROM base AS development
|
|
WORKDIR /app
|
|
COPY package*.json ./
|
|
RUN npm install
|
|
COPY . .
|
|
EXPOSE 4321
|
|
CMD ["npm", "run", "dev", "--", "--host", "0.0.0.0"]
|
|
|
|
# Build stage for production
|
|
FROM base AS builder
|
|
WORKDIR /app
|
|
ARG SITE_URL=https://forrest.warehack.ing
|
|
ENV SITE_URL=${SITE_URL}
|
|
COPY package*.json ./
|
|
RUN npm ci
|
|
COPY . .
|
|
RUN npm run build
|
|
|
|
# Production target - serve static files with Caddy
|
|
FROM caddy:alpine AS production
|
|
COPY --from=builder /app/dist /srv
|
|
COPY Caddyfile /etc/caddy/Caddyfile
|
|
EXPOSE 4321
|
|
CMD ["caddy", "run", "--config", "/etc/caddy/Caddyfile"]
|