Skip to content

Commit 3744d3a

Browse files
committed
Reorganize the Dockerfile to allow for more sensible layer caching.
The app code is now copied after OpenResty is installed.
1 parent 1ca9b6a commit 3744d3a

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

docker/Dockerfile

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,6 @@ EXPOSE 80
3131
EXPOSE 81
3232
EXPOSE 443
3333

34-
COPY docker/rootfs /
35-
ADD backend /app
36-
ADD frontend/dist /app/frontend
37-
38-
WORKDIR /app
39-
RUN yarn install
40-
41-
# Remove frontend service not required for prod, dev nginx config as well
42-
RUN rm -rf /etc/services.d/frontend RUN rm -f /etc/nginx/conf.d/dev.conf
43-
4434
RUN mkdir -p /opt/luarocks-build && cd /opt/luarocks-build && apk add readline-dev perl pcre-dev openssl-dev zlib-dev
4535
RUN wget -O /opt/luarocks-build/luarocks-3.3.1.tar.gz http://luarocks.github.io/luarocks/releases/luarocks-3.3.1.tar.gz && wget -O /opt/luarocks-build/lua-5.1.5.tar.gz http://www.lua.org/ftp/lua-5.1.5.tar.gz
4636
RUN mkdir -p /opt/openresty-build && cd /opt/openresty-build && wget -O /opt/openresty-build/openresty-1.15.8.3.tar.gz https://openresty.org/download/openresty-1.15.8.3.tar.gz
@@ -87,6 +77,16 @@ RUN cd /opt/luarocks-build/lua-5.1.5 && make linux test && make install
8777
RUN cd /opt/luarocks-build/luarocks-3.3.1 && ./configure && make && make install
8878
RUN apk add unzip && luarocks install lua-resty-openidc && luarocks install lua-cjson
8979

80+
COPY docker/rootfs /
81+
ADD backend /app
82+
ADD frontend/dist /app/frontend
83+
84+
WORKDIR /app
85+
RUN yarn install
86+
87+
# Remove frontend service not required for prod, dev nginx config as well
88+
RUN rm -rf /etc/services.d/frontend RUN rm -f /etc/nginx/conf.d/dev.conf
89+
9090
VOLUME [ "/data", "/etc/letsencrypt" ]
9191
CMD [ "/init" ]
9292

0 commit comments

Comments
 (0)