2022-09-24 20:04:58 +02:00
|
|
|
FROM docker.io/immawanderer/alpine-hugo:hugo-v0.103.0 AS hugobuild
|
2021-07-24 14:45:23 +02:00
|
|
|
|
|
|
|
WORKDIR /docs
|
|
|
|
|
2022-09-24 20:08:27 +02:00
|
|
|
COPY . /docs
|
|
|
|
|
2021-07-24 14:45:23 +02:00
|
|
|
RUN git submodule init \
|
2022-09-24 20:08:27 +02:00
|
|
|
&& git submodule update --recursive \
|
|
|
|
&& hugo version \
|
|
|
|
&& hugo --minify --gc=true
|
2021-07-24 14:45:23 +02:00
|
|
|
|
|
|
|
|
2022-09-24 20:15:03 +02:00
|
|
|
FROM docker.io/library/nginx:mainline-alpine
|
2021-07-24 14:45:23 +02:00
|
|
|
# COPY --from=hugobuild /home/$(whoami)/public/ /usr/share/nginx/html
|
|
|
|
COPY --from=hugobuild /docs/public/ /usr/share/nginx/html
|
|
|
|
|
|
|
|
# tripple slash reference
|
|
|
|
# https://stackoverflow.com/questions/5190966/using-sed-to-insert-tabs/5191165#5191165
|
|
|
|
RUN sed -i -e 's/^worker_processes auto;/worker_processes auto;/'\
|
|
|
|
-e "/^events {$/ a \\\tmulti_accept on;\n\tuse epoll;"\
|
|
|
|
-e "/^http {$/ a \\\tserver_tokens off;\n\tetag off;\n"\
|
|
|
|
-e 's/#tcp_nopush/tcp_nopush/'\
|
|
|
|
-e "/tcp_nopush/ a \\\ttcp_nodelay on;"\
|
|
|
|
-e "s/^ */$(printf '\t')/"\
|
|
|
|
/etc/nginx/nginx.conf
|