# Front end: static HTML/JS served by nginx (non-root image, listens on 8080)
FROM nginxinc/nginx-unprivileged:1.27-alpine

# Where /api/ requests go. The back-end container's name on the shared network.
ENV BACKEND_URL=http://backend:8000

COPY default.conf.template /etc/nginx/templates/default.conf.template
COPY site/ /usr/share/nginx/html/

EXPOSE 8080
HEALTHCHECK --interval=10s --timeout=3s --retries=3 \
  CMD wget -qO- http://127.0.0.1:8080/healthz || exit 1
