From 425e1b54ef3368852afea8f025ce87a2d507277c Mon Sep 17 00:00:00 2001 From: acaranta Date: Thu, 22 Apr 2021 00:06:09 +0200 Subject: [PATCH] Changed the multistage build to squeeze only heavy install steps --- Dockerfile | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 300d78a..62dedaa 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,17 +22,6 @@ RUN apt-get -y remove build-essential ".*-dev" git gcc make && \ apt-get -y autoremove && \ rm -rf /var/lib/apt/lists/* /var/cache/apt/* -ADD . /app -WORKDIR /app - -RUN mkdir -p /etc/supervisor && cp /app/supervisord.conf.tpl /etc/supervisor/supervisord.conf.tpl -RUN cp /app/dir-prereqs.sh /dir-prereqs.sh -RUN cp /app/haproxy.cfg /etc/haproxy -#Source : https://raw.githubusercontent.com/haproxytech/haproxy-lua-http/master/http.lua -RUN cp /app/lua/haproxy-lua-http.lua /usr/share/lua/5.3/haproxy-lua-http.lua -#Source : https://raw.githubusercontent.com/TimWolla/haproxy-auth-request/master/auth-request.lua -RUN cp /app/lua/auth-request.lua /etc/haproxy/auth-request.lua - #Multistage build FROM scratch @@ -51,6 +40,17 @@ ENV SYSLOG_PROTO udp VOLUME ["/hacfg"] +ADD . /app +WORKDIR /app + +RUN mkdir -p /etc/supervisor && cp /app/supervisord.conf.tpl /etc/supervisor/supervisord.conf.tpl +RUN cp /app/dir-prereqs.sh /dir-prereqs.sh +RUN cp /app/haproxy.cfg /etc/haproxy +#Source : https://raw.githubusercontent.com/haproxytech/haproxy-lua-http/master/http.lua +RUN cp /app/lua/haproxy-lua-http.lua /usr/share/lua/5.3/haproxy-lua-http.lua +#Source : https://raw.githubusercontent.com/TimWolla/haproxy-auth-request/master/auth-request.lua +RUN cp /app/lua/auth-request.lua /etc/haproxy/auth-request.lua + EXPOSE 80 CMD . ./dir-prereqs.sh && for FILE in $TPLFILES; do envtpl --keep-template --allow-missing $FILE.tpl; done && ./run.sh