mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-08-03 13:37:27 +02:00
#315 fixed docker compose error and switched to PHP 7.2.0
This commit is contained in:
7
Dockerfile
Normal file
7
Dockerfile
Normal file
@@ -0,0 +1,7 @@
|
||||
FROM php:7.2.0-cli
|
||||
WORKDIR /opt/php
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y zlib1g-dev wget git-core \
|
||||
&& docker-php-ext-install zip
|
||||
ADD . /opt/php
|
||||
CMD [ "./docker/test_runner.sh" ]
|
@@ -1,9 +1,9 @@
|
||||
version: "3.1"
|
||||
|
||||
services:
|
||||
php:
|
||||
image: php:7.1.7-cli
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
volumes:
|
||||
- .:/opt/php
|
||||
privileged: true
|
||||
command: ["/opt/php/docker/test_runner.sh"]
|
||||
command: ["/opt/php/docker/test_runner.sh"]
|
||||
|
@@ -1,12 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
cd /opt/php
|
||||
#!/bin/sh
|
||||
|
||||
echo "Installing composer..."
|
||||
EXPECTED_SIGNATURE=$(wget -q -O - https://composer.github.io/installer.sig)
|
||||
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
|
||||
php -r "if (hash_file('SHA384', 'composer-setup.php') === '669656bab3166a7aff8a7506b8cb2d1c292f042046c5a994c43155c0be6190fa0355160742ab2e1c88d40d5be660b410') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
|
||||
php composer-setup.php
|
||||
php -r "unlink('composer-setup.php');"
|
||||
ACTUAL_SIGNATURE=$(php -r "echo hash_file('SHA384', 'composer-setup.php');")
|
||||
|
||||
if [ "$EXPECTED_SIGNATURE" != "$ACTUAL_SIGNATURE" ]
|
||||
then
|
||||
>&2 echo 'ERROR: Invalid installer signature'
|
||||
rm composer-setup.php
|
||||
exit 1
|
||||
fi
|
||||
|
||||
php composer-setup.php --quiet
|
||||
rm composer-setup.php
|
||||
|
||||
echo "Downloading dependencies using composer..."
|
||||
php composer.phar install --prefer-dist --no-interaction
|
||||
|
Reference in New Issue
Block a user