Reorganize Dockerfile instructions for faster rebuilds

This commit is contained in:
Petr Sloup 2017-09-20 08:03:46 +02:00
parent 02cf45bbd9
commit d60996e3c6
2 changed files with 12 additions and 16 deletions

View File

@ -1,6 +1,12 @@
FROM node:6-stretch FROM node:6-stretch
MAINTAINER Petr Sloup <petr.sloup@klokantech.com> MAINTAINER Petr Sloup <petr.sloup@klokantech.com>
ENV NODE_ENV="production"
VOLUME /data
WORKDIR /data
EXPOSE 80
ENTRYPOINT ["/usr/src/app/run.sh"]
RUN apt-get -qq update \ RUN apt-get -qq update \
&& DEBIAN_FRONTEND=noninteractive apt-get -y install \ && DEBIAN_FRONTEND=noninteractive apt-get -y install \
apt-transport-https \ apt-transport-https \
@ -20,11 +26,3 @@ RUN apt-get -qq update \
RUN mkdir -p /usr/src/app RUN mkdir -p /usr/src/app
COPY / /usr/src/app COPY / /usr/src/app
RUN cd /usr/src/app && npm install --production RUN cd /usr/src/app && npm install --production
VOLUME /data
WORKDIR /data
ENV NODE_ENV="production"
EXPOSE 80
ENTRYPOINT ["/usr/src/app/run.sh"]

View File

@ -1,14 +1,12 @@
FROM node:6 FROM node:6
MAINTAINER Petr Sloup <petr.sloup@klokantech.com> MAINTAINER Petr Sloup <petr.sloup@klokantech.com>
ENV NODE_ENV="production"
EXPOSE 80
VOLUME /data
WORKDIR /data
ENTRYPOINT ["node", "/usr/src/app/", "-p", "80"]
RUN mkdir -p /usr/src/app RUN mkdir -p /usr/src/app
COPY / /usr/src/app COPY / /usr/src/app
RUN cd /usr/src/app && npm install --production RUN cd /usr/src/app && npm install --production
VOLUME /data
WORKDIR /data
ENV NODE_ENV="production"
EXPOSE 80
ENTRYPOINT ["node", "/usr/src/app/", "-p", "80"]