FROM docker.io/library/node:22-bookworm-slim AS build

ARG WEBMENTION_TOKEN=""
ENV WEBMENTION_TOKEN=$WEBMENTION_TOKEN

WORKDIR /app

COPY package.json package-lock.json ./

RUN npm ci

COPY . .

RUN npm run build


FROM docker.io/library/nginx:alpine AS runtime

COPY --from=build /app/dist /usr/share/nginx/html

EXPOSE 80

CMD ["nginx", "-g", "daemon off;"]
