# Added by the Noite project on 2026-11-10 under the Apache License 2.0: production image of the Noite site for Dokploy, built from apps/site alone and served by nginx.
FROM node:22.22.1-bookworm-slim AS build
RUN npm install -g pnpm@11.1.3 && pnpm --version
WORKDIR /site
ENV CI=1
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
RUN pnpm install --frozen-lockfile --config.strict-dep-builds=false
COPY . .
ARG SITE_URL=https://noite.tech
ENV SITE_URL=$SITE_URL
RUN pnpm --config.verify-deps-before-run=false run build \
  && test -f dist/index.html && test -f dist/404.html && test -f dist/privacy/index.html && test -f dist/terms/index.html

FROM docker.io/library/nginx:1.31.8-alpine@sha256:1ef7ca94d7879df82421428ce13bd1eaa412404953859cf7a5b6512c25e67a60
COPY nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build /site/dist /usr/share/nginx/html
EXPOSE 80
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
  CMD wget -q -O /dev/null http://127.0.0.1/health || exit 1
