Skip to content

Commit

Permalink
Merge pull request #52 from giannicic/docker-compose-pinning
Browse files Browse the repository at this point in the history
Using docker multi-stage to pin composer to a specific version
  • Loading branch information
Ocramius authored May 6, 2022
2 parents b7d569c + 85f1678 commit 6e29404
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
# docker build -f Dockerfile-dev -t api-tools .
# docker run -it -p "8080:80" -v $PWD:/var/www api-tools
#
FROM composer:2.3.5 AS get-composer
FROM php:8.0-apache

RUN apt-get update \
Expand All @@ -31,7 +32,8 @@ RUN apt-get update \
&& a2enmod rewrite \
&& sed -i 's!/var/www/html!/var/www/public!g' /etc/apache2/sites-available/000-default.conf \
&& mv /var/www/html /var/www/public \
&& curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \
&& echo "AllowEncodedSlashes On" >> /etc/apache2/apache2.conf

COPY --from=get-composer /usr/bin/composer /usr/local/bin/composer

WORKDIR /var/www

0 comments on commit 6e29404

Please sign in to comment.