Skip to content

Commit f8fe34a

Browse files
Fix local Docker caching
Signed-off-by: Christoph Wurst <[email protected]>
1 parent 4aa24bd commit f8fe34a

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

.dockerignore

+1
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ storage/framework/sessions/*
1212
storage/framework/views/*
1313
storage/logs/*
1414
tests
15+
vendor

Dockerfile

+10-5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
1+
FROM weinstein/composer:latest as php-builder
2+
COPY composer* ./
3+
RUN php -f composer.phar install \
4+
--no-autoloader \
5+
--no-scripts \
6+
--no-interaction
7+
COPY . .
8+
RUN php -f composer.phar install --no-dev -o
19
FROM node:9.5.0 as js-builder
10+
211
WORKDIR /app
312
COPY package*.json /app/
413
RUN npm install
@@ -7,15 +16,11 @@ RUN ./node_modules/bower/bin/bower install --allow-root
716
COPY . .
817
RUN ./node_modules/grunt-cli/bin/grunt
918

10-
FROM weinstein/composer:latest as php-builder
11-
COPY . .
12-
RUN php -f composer.phar install --no-dev -o
13-
1419
FROM weinstein/webserver:latest
1520
COPY . /var/www
21+
COPY --from=php-builder /var/www/vendor /var/www/vendor
1622
COPY --from=js-builder /app/public/css/*.css /var/www/public/css/
1723
COPY --from=js-builder /app/public/js /var/www/public/js
18-
COPY --from=php-builder /var/www/vendor /var/www/vendor
1924
USER root
2025
RUN chown -R www-data /var/www && \
2126
chgrp -R 0 /var/www && \

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"php": ">=7.1.0",
1111
"ext-zip": "1.*",
1212
"ext-zlib": "*",
13-
"laravel/framework": "5.6.*",
13+
"laravel/framework": "5.2.*",
1414
"itbz/fpdf": "1.7.3",
1515
"laravelcollective/html": "^5.2",
1616
"fzaninotto/faker": "~1.4",

0 commit comments

Comments
 (0)