Skip to content

Commit 23e7152

Browse files
committed
Merge pull request #397 from luxas/faster_builds
Faster dockerized builds because of configuration only caching
2 parents e5a1b9d + 0d64276 commit 23e7152

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Dockerfile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ RUN curl -sL https://deb.nodesource.com/setup_5.x | bash - \
2626
file \
2727
python \
2828
openjdk-7-jre \
29-
nodejs \
29+
nodejs \
3030
&& rm -rf /var/lib/apt/lists/* \
3131
&& apt-get clean
3232

@@ -37,7 +37,13 @@ RUN curl -sSL https://get.docker.com/builds/Linux/x86_64/docker-1.9.1 > /usr/bin
3737
# Current directory is always /dashboard
3838
WORKDIR /dashboard
3939

40-
COPY ./ ./
40+
# Copy over package.json bower.json and postinstall.sh.
41+
# Why? Because of docker caching, npm install will only run again if one of these have changed
42+
COPY package.json bower.json ./
43+
COPY build/postinstall.sh build/
4144

4245
# Install all npm deps, bower deps and godep. This will take a while.
4346
RUN npm install --unsafe-perm
47+
48+
# Copy over the rest of the source
49+
COPY ./ ./

0 commit comments

Comments
 (0)