docs/Dockerfile
surtur 4bc2650892
All checks were successful
continuous-integration/drone/push Build is passing
ci: add a deploy step using docker-compose
docs image is built JIT from Dockerfile.
the logic for the compose file is based on the one used in
https://git.dotya.ml/dotya.ml/homepage yet the traefik part was not
used.
2021-07-24 15:17:32 +02:00

27 lines
802 B
Docker

FROM immawanderer/fedora-hugo:latest AS hugobuild
RUN mkdir -pv /docs
COPY . /docs
WORKDIR /docs
RUN git submodule init \
&& git submodule update --recursive \
&& hugo version
RUN hugo --minify --gc=true
# WORKDIR /
FROM nginx:mainline-alpine
# 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