From 0ab47a2b751be0400b38a80764a3ecaf364b2088 Mon Sep 17 00:00:00 2001 From: Mateusz Sip Date: Thu, 26 Oct 2017 14:51:56 +0200 Subject: [PATCH] Support specific version --- Dockerfile | 5 ++++- docker-compose.yaml | 3 +++ docker/app/docker-entrypoint.sh | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 725464f..38b8548 100644 --- a/Dockerfile +++ b/Dockerfile @@ -39,8 +39,11 @@ RUN composer global require "hirak/prestissimo:^0.3" --prefer-dist --no-progress ARG STABILITY=stable ENV STABILITY ${STABILITY} +# Allow to select skeleton version +ARG VERSION="" + # Download the Symfony skeleton and leverage Docker cache layers -RUN composer create-project "symfony/skeleton" . --stability=$STABILITY --prefer-dist --no-dev --no-progress --no-scripts --no-plugins --no-interaction +RUN composer create-project "symfony/skeleton ${VERSION}" . --stability=$STABILITY --prefer-dist --no-dev --no-progress --no-scripts --no-plugins --no-interaction ###> recipes ### ###< recipes ### diff --git a/docker-compose.yaml b/docker-compose.yaml index 606cc54..68a23eb 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -4,6 +4,9 @@ services: app: build: context: . + args: + VERSION: ${SYMFONY_VERSION} + STABILITY: stable volumes: # Comment out the next line in production - ./:/srv/app:rw diff --git a/docker/app/docker-entrypoint.sh b/docker/app/docker-entrypoint.sh index 6aee256..7b3fad6 100755 --- a/docker/app/docker-entrypoint.sh +++ b/docker/app/docker-entrypoint.sh @@ -9,7 +9,7 @@ fi if [ "$1" = 'php-fpm' ] || [ "$1" = 'bin/console' ]; then # The first time volumes are mounted, the project needs to be recreated if [ ! -f composer.json ]; then - composer create-project "symfony/skeleton" tmp --stability=$STABILITY --prefer-dist --no-progress --no-interaction + composer create-project "symfony/skeleton $VERSION" tmp --stability=$STABILITY --prefer-dist --no-progress --no-interaction cp -Rp tmp/. . rm -Rf tmp/ elif [ "$APP_ENV" != 'prod' ]; then