From 9091749a9df5d866ab35cb84b131ce069b2935ba Mon Sep 17 00:00:00 2001 From: Cedric Ziel Date: Thu, 11 Feb 2021 08:49:57 +0100 Subject: [PATCH] Fix implicit upgrade of composer to version 2 --- ratings/Dockerfile | 16 +++++----------- ratings/{ => html}/composer.json | 14 +++++++------- 2 files changed, 12 insertions(+), 18 deletions(-) rename ratings/{ => html}/composer.json (59%) diff --git a/ratings/Dockerfile b/ratings/Dockerfile index ff89e02..f5a155a 100644 --- a/ratings/Dockerfile +++ b/ratings/Dockerfile @@ -1,16 +1,10 @@ -# Use composer to install dependencies -FROM composer AS build - -COPY composer.json /app/ - -RUN composer install - # # Build the app # FROM php:7.4-apache -RUN docker-php-ext-install pdo_mysql +RUN apt-get update && apt-get install -yqq unzip libzip-dev \ + && docker-php-ext-install pdo_mysql opcache zip # Enable AutoProfile for PHP which is currently opt-in beta RUN echo "instana.enable_auto_profile=1" > "/usr/local/etc/php/conf.d/zzz-instana-extras.ini" @@ -22,11 +16,11 @@ RUN a2enmod rewrite && a2enmod status WORKDIR /var/www/html -# copy dependencies from previous step -COPY --from=build /app/vendor/ /var/www/html/vendor/ - COPY html/ /var/www/html +COPY --from=composer /usr/bin/composer /usr/bin/composer +RUN composer install + # This is important. Symfony needs write permissions and we # dont know the context in which the container will run, i.e. # which user will be forced from the outside so better play diff --git a/ratings/composer.json b/ratings/html/composer.json similarity index 59% rename from ratings/composer.json rename to ratings/html/composer.json index e9ed27a..993e534 100644 --- a/ratings/composer.json +++ b/ratings/html/composer.json @@ -1,17 +1,17 @@ { "require": { - "php": "^7.3", + "php": "^7.4", "ext-curl": "*", "ext-json": "*", "ext-pdo": "*", "psr/log": "*", "monolog/monolog": "^1.24.0", - "symfony/config": "^5.0", - "symfony/http-kernel": "^5.0", - "symfony/http-foundation": "^5.0", - "symfony/routing": "^5.0", - "symfony/dependency-injection": "^5.0", - "symfony/framework-bundle": "^5.0", + "symfony/config": "^5.2", + "symfony/http-kernel": "^5.2", + "symfony/http-foundation": "^5.2", + "symfony/routing": "^5.2", + "symfony/dependency-injection": "^5.2", + "symfony/framework-bundle": "^5.2", "doctrine/annotations": "^1.10", "symfony/monolog-bundle": "^3.5", "instana/instana-php-sdk": "^1.10"