Skip to content

Commit 867b8e4

Browse files
committed
Improve development workflow in Dockerfile
We should leverage docker caching so builds take less time.
1 parent 95bb724 commit 867b8e4

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Dockerfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ FROM alpine:edge
33
MAINTAINER Code Climate <[email protected]>
44

55
WORKDIR /usr/src/app
6-
COPY . /usr/src/app
7-
86
# Install PHP
97
RUN apk --update add \
108
php7 \
@@ -23,13 +21,18 @@ RUN apk --update add \
2321
rm /var/cache/apk/* && \
2422
ln -s /usr/bin/php7 /usr/bin/php
2523

24+
COPY composer.json /usr/src/app/composer.json
25+
COPY composer.lock /usr/src/app/composer.lock
26+
2627
RUN apk --update add curl && \
2728
curl -sS https://getcomposer.org/installer | php && \
2829
./composer.phar install && \
2930
apk del curl && \
3031
rm /usr/src/app/composer.phar \
3132
/var/cache/apk/*
3233

34+
COPY bin/build-content /usr/src/app/bin/build-content
35+
3336
# Build Content
3437
RUN apk --update add build-base ca-certificates ruby ruby-dev && \
3538
gem install json httparty --no-rdoc --no-ri && \
@@ -38,6 +41,8 @@ RUN apk --update add build-base ca-certificates ruby ruby-dev && \
3841
apk del build-base ca-certificates ruby ruby-dev && \
3942
rm /var/cache/apk/*
4043

44+
COPY . /usr/src/app
45+
4146
RUN adduser -u 9000 -D app
4247
RUN chown -R app:app .
4348

0 commit comments

Comments
 (0)