File tree 2 files changed +12
-12
lines changed
2 files changed +12
-12
lines changed Original file line number Diff line number Diff line change 1
1
FROM php:7.1-fpm-alpine
2
2
3
+ WORKDIR /srv/app
4
+
3
5
RUN apk add --no-cache --virtual .persistent-deps \
4
6
git \
5
7
icu-libs \
6
- make \
7
8
zlib
8
9
9
10
ENV APCU_VERSION 5.1.8
10
-
11
11
RUN set -xe \
12
12
&& apk add --no-cache --virtual .build-deps \
13
13
$PHPIZE_DEPS \
@@ -38,22 +38,19 @@ RUN set -xe \
38
38
ENV COMPOSER_ALLOW_SUPERUSER 1
39
39
40
40
# Use prestissimo to speed up builds
41
- RUN composer global require "hirak/prestissimo:^0.3" --prefer-dist --no-progress --no-suggest --optimize-autoloader --classmap-authoritative
41
+ RUN composer global require "hirak/prestissimo:^0.3" --prefer-dist --no-progress --no-suggest --optimize-autoloader --classmap-authoritative --no-interaction
42
42
43
43
COPY docker/app/docker-entrypoint.sh /usr/local/bin/docker-app-entrypoint
44
44
RUN chmod +x /usr/local/bin/docker-app-entrypoint
45
45
46
46
# Download the Symfony skeleton and leverage Docker cache layers
47
- ENV SKELETON_COMPOSER_JSON https://raw.githubusercontent.com/symfony/skeleton/v3.3.4/composer.json
48
-
49
- WORKDIR /srv/app
50
- RUN php -r "copy('$SKELETON_COMPOSER_JSON', 'composer.json');" \
51
- && composer install --prefer-dist --no-dev --no-progress --no-suggest --no-autoloader --no-scripts --no-plugins --no-interaction
47
+ ENV STABILITY stable
48
+ RUN composer create-project "symfony/skeleton" . --stability=$STABILITY --prefer-dist --no-dev --no-progress --no-scripts --no-plugins --no-interaction
52
49
53
50
COPY . .
54
51
55
52
RUN mkdir -p var/cache var/logs var/sessions \
56
- && composer install --prefer-dist --no-dev --no-progress --no-suggest --optimize-autoloader -- classmap-authoritative --no-interaction \
53
+ && composer install --prefer-dist --no-dev --no-progress --no-suggest --classmap-authoritative --no-interaction \
57
54
&& composer clear-cache \
58
55
&& chown -R www-data var # Permissions hack because setfacl does not work on Mac and Windows
59
56
Original file line number Diff line number Diff line change @@ -7,10 +7,13 @@ if [ "${1#-}" != "$1" ]; then
7
7
fi
8
8
9
9
if [ " $1 " = ' php-fpm' ] || [ " $1 " = ' bin/console' ]; then
10
- # The first time volumes are mounted, dependencies need to be reinstalled
10
+ # The first time volumes are mounted, the project needs to be recreated
11
11
if [ ! -f composer.json ]; then
12
- rm -Rf vendor/*
13
- php -r " copy('$SKELETON_COMPOSER_JSON ', 'composer.json');"
12
+ composer create-project " symfony/skeleton" tmp --stability=$STABILITY --prefer-dist --no-progress --no-interaction
13
+ cp -Rp tmp/. .
14
+ rm -Rf tmp/
15
+ elif [ " $APP_ENV " != ' prod' ]; then
16
+ # Always try to reinstall deps when not in prod
14
17
composer install --prefer-dist --no-progress --no-suggest --no-interaction
15
18
fi
16
19
You can’t perform that action at this time.
0 commit comments