Files

18 lines
614 B
Docker

FROM node:22-alpine AS build
WORKDIR /app
RUN corepack enable
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile
COPY . .
# Public URL baked into canonical/OG/JSON-LD tags; pass your domain at build
# time (or set it in .env). An empty arg must not shadow the .env value, so
# unset it when blank — process.env beats .env files in Vite.
ARG VITE_SITE_URL=
RUN if [ -z "$VITE_SITE_URL" ]; then unset VITE_SITE_URL; fi && pnpm build
FROM nginx:alpine
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build /app/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]