Skip to content

Commit

Permalink
Changed the multistage build to squeeze only heavy install steps
Browse files Browse the repository at this point in the history
  • Loading branch information
acaranta committed Apr 21, 2021
1 parent 59962b1 commit 425e1b5
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

0 comments on commit 425e1b5

Please sign in to comment.