FROM node:alpine AS build RUN apk --no-cache add git && \ git clone https://github.com/jackyzha0/quartz.git && \ cd quartz && git checkout v4.4.0 && cd .. && \ mkdir -p /usr/share/nginx/html && \ mv quartz/* /usr/share/nginx/html && \ rm -rf /usr/share/nginx/html/docs && \ cd /usr/share/nginx/html && \ npm ci && npx quartz build && \ rm -rf /usr/share/nginx/html/node_modules FROM nginx:stable-alpine3.20 COPY --from=build /usr/share/nginx/html /usr/share/nginx/html COPY default.conf.template /etc/nginx/templates/default.conf.template WORKDIR /usr/share/nginx/html RUN apk --no-cache add nodejs npm bash dumb-init git && \ rm -rf /var/cache/apk/* RUN ln -s /usr/share/nginx/html/content / && \ chown -R nginx:nginx /usr/share/nginx/html && \ chown -R nginx:nginx /usr/share/nginx/html/content ENV NGINX_PORT=80 ENV BASE_URL="quartz.zhao.xyz" ENV PAGE_TITLE="Quartz Docker" ENV ENABLE_SPA="true" ENV ENABLE_POPOVERS="true" ENV ANALYTICS_PROVIDER="plausible" ENV IGNORE_PATTERNS="private,templates" ENV TYPOGRAPHY_HEADER="Schibsted Grotesk" ENV TYPOGRAPHY_BODY="Source Sans Pro" ENV TYPOGRAPHY_CODE="IBM-Plex Mono" ENV LIGHTMODE_LIGHT="#faf8f8" ENV LIGHTMODE_LIGHTGRAY="#e5e5e5" ENV LIGHTMODE_GRAY="#bbbbbb" ENV LIGHTMODE_DARKGRAY="#4e4e4e" ENV LIGHTMODE_DARK="#2b2b2b" ENV LIGHTMODE_SECONDARY="#284b63" ENV LIGHTMODE_TERTIARY="#84a59d" ENV LIGHTMODE_HIGHLIGHT="rgba(143,159,169,0.15)" ENV DARKMODE_LIGHT="#161618" ENV DARKMODE_LIGHTGRAY="#393639" ENV DARKMODE_GRAY="#646464" ENV DARKMODE_DARKGRAY="#4d4d4d" ENV DARKMODE_DARK="#ebebec" ENV DARKMODE_SECONDARY="#7b97aa" ENV DARKMODE_TERTIARY="#84a59d" ENV DARKMODE_HIGHLIGHT="rgba(143,159,169,0.15)" COPY entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh ENTRYPOINT ["dumb-init", "--"] CMD ["/entrypoint.sh"] LABEL org.opencontainers.image.source="https://code.modernleft.org/gravityfargo/quartz-docker" LABEL org.opencontainers.image.url="https://quartz.jzhao.xyz/" LABEL org.opencontainers.image.description="A docker image for Quartz, a static site generator." LABEL org.opencontainers.image.licenses="MIT" LABEL org.opencontainers.image.authors="Nathan Price "