2021-01-24 16:15:28 +01:00
|
|
|
FROM immawanderer/fedora-hugo:latest AS hugobuild
|
2020-10-03 21:00:19 +02:00
|
|
|
RUN mkdir -pv /homepage
|
|
|
|
COPY . /homepage
|
|
|
|
|
|
|
|
WORKDIR /homepage
|
|
|
|
|
|
|
|
RUN git submodule init \
|
|
|
|
&& git submodule update --recursive \
|
|
|
|
&& hugo version
|
2021-08-08 00:10:47 +02:00
|
|
|
# "DL3059 info: Multiple consecutive `RUN` instructions.
|
|
|
|
# Consider consolidation."
|
|
|
|
# hadolint ignore=DL3059
|
2020-10-03 21:00:19 +02:00
|
|
|
RUN hugo --minify --gc=true
|
|
|
|
|
|
|
|
WORKDIR /
|
|
|
|
|
2020-11-25 15:33:41 +01:00
|
|
|
FROM nginx:mainline-alpine
|
2021-01-24 16:15:28 +01:00
|
|
|
COPY --from=hugobuild /homepage/public/ /usr/share/nginx/html
|
2020-11-25 15:33:41 +01:00
|
|
|
|
|
|
|
# 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
|