<commit_before>##
## Step 1 - add content and build with Hugo
##

FROM r.c5h.io/hugo as hugo

ADD site /tmp/site
RUN hugo -b https://www.chameth.com/ -v -s /tmp/site -d /tmp/hugo && \
	cp /tmp/hugo/index.xml /tmp/hugo/feed.xml

##
## Step 2 - compress, minify, etc
##

FROM debian:stretch as minify
RUN apt-get update \
    && DEBIAN_FRONTEND=noninteractive apt-get -qq install -y --no-install-recommends yui-compressor tidy webp \
	&& rm -rf /var/lib/apt/lists/*

COPY --from=hugo /tmp/hugo /tmp/site
ADD minify.sh /tmp/minify.sh

RUN chown -R nobody:nogroup /tmp/site && chmod +x /tmp/minify.sh
USER nobody:nogroup
RUN /tmp/minify.sh

##
## Step 3 - host!
##

FROM nginx:mainline-alpine AS nginx
COPY --from=minify /tmp/site /usr/share/nginx/html
ADD nginx.conf /etc/nginx/nginx.conf
VOLUME /logs
<commit_msg>Only publish posts RSS feed<commit_after>##
## Step 1 - add content and build with Hugo
##

FROM r.c5h.io/hugo as hugo

ADD site /tmp/site
RUN hugo -b https://www.chameth.com/ -v -s /tmp/site -d /tmp/hugo && \
	cp /tmp/hugo/post/index.xml /tmp/hugo/feed.xml && \
	cp /tmp/hugo/post/index.xml /tmp/hugo/index.xml

##
## Step 2 - compress, minify, etc
##

FROM debian:stretch as minify
RUN apt-get update \
    && DEBIAN_FRONTEND=noninteractive apt-get -qq install -y --no-install-recommends yui-compressor tidy webp \
	&& rm -rf /var/lib/apt/lists/*

COPY --from=hugo /tmp/hugo /tmp/site
ADD minify.sh /tmp/minify.sh

RUN chown -R nobody:nogroup /tmp/site && chmod +x /tmp/minify.sh
USER nobody:nogroup
RUN /tmp/minify.sh

##
## Step 3 - host!
##

FROM nginx:mainline-alpine AS nginx
COPY --from=minify /tmp/site /usr/share/nginx/html
ADD nginx.conf /etc/nginx/nginx.conf
VOLUME /logs

{'fraction_non_alphanumeric': 0.1528023598820059, 'fraction_numerical': 0.00471976401179941, 'mean_word_length': 3.018957345971564, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1237360', 'n_tokens_mistral': 725, 'n_tokens_neox': 703, 'n_words': 181}