
ARG DOC_UTILS_VERSION
ARG NGINX_VERSION

FROM gitea.jbrumond.me/doc-utils/utils:${DOC_UTILS_VERSION} AS build_stage
WORKDIR /workspace

COPY docs/ /workspace/docs
COPY layouts/ /workspace/layouts
COPY partials/ /workspace/partials
COPY config.yaml metadata.json /workspace/

# build website from source files
RUN mkdir /workspace/www
RUN docs2website config.yaml



FROM nginx:${NGINX_VERSION} AS deploy_stage
EXPOSE 80

# copy actual web content built above
COPY --from=build_stage --chown=nginx:nginx /workspace/www/ /usr/share/nginx/html

# nginx config files
COPY --chown=nginx:nginx conf/nginx.conf /etc/nginx/nginx.conf
COPY --chown=nginx:nginx conf/default.conf /etc/nginx/conf.d/default.conf
COPY --chown=nginx:nginx conf/mime.types /etc/nginx/mime.types
