-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from DaveLiddament/feature/add-docker
ADD docker
- Loading branch information
Showing
3 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
ARG PHP_VERSION | ||
FROM php:${PHP_VERSION}cli | ||
|
||
# Increase memory limit | ||
RUN echo 'memory_limit = -1' >> /usr/local/etc/php/conf.d/docker-php-memlimit.ini | ||
|
||
# install Composer | ||
COPY ./docker/composer.sh /root/ | ||
|
||
RUN <<EOF | ||
set -eux; | ||
apt-get update; | ||
apt-get install -y \ | ||
git \ | ||
zip; | ||
rm -rf /var/lib/apt/lists/*; | ||
cd /root/; | ||
chmod 755 composer.sh; | ||
/root/composer.sh; | ||
mv /root/composer.phar /usr/local/bin/composer; | ||
rm /root/composer.sh; | ||
EOF | ||
|
||
# install Xdebug | ||
ARG XDEBUG_ENABLED=1 | ||
|
||
RUN <<EOF | ||
if [ $XDEBUG_ENABLED -eq 1 ]; then | ||
pecl install xdebug; | ||
docker-php-ext-enable xdebug; | ||
fi | ||
EOF | ||
|
||
WORKDIR /app/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
services: | ||
latest: | ||
build: | ||
args: | ||
PHP_VERSION: "" | ||
tty: true | ||
volumes: | ||
- .:/app/ | ||
php80: | ||
build: | ||
args: | ||
PHP_VERSION: "8.0-" | ||
extends: | ||
service: latest | ||
php81: | ||
build: | ||
args: | ||
PHP_VERSION: "8.1-" | ||
extends: | ||
service: latest | ||
php82: | ||
build: | ||
args: | ||
PHP_VERSION: "8.2-" | ||
extends: | ||
service: latest | ||
php83: | ||
build: | ||
args: | ||
PHP_VERSION: "8.3-" | ||
extends: | ||
service: latest | ||
php84: | ||
build: | ||
args: | ||
PHP_VERSION: "8.4-rc-" | ||
XDEBUG_ENABLED: 0 | ||
extends: | ||
service: latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/sh | ||
|
||
# copied from https://getcomposer.org/doc/faqs/how-to-install-composer-programmatically.md | ||
|
||
EXPECTED_CHECKSUM="$(php -r 'copy("https://composer.github.io/installer.sig", "php://stdout");')" | ||
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" | ||
ACTUAL_CHECKSUM="$(php -r "echo hash_file('sha384', 'composer-setup.php');")" | ||
|
||
if [ "$EXPECTED_CHECKSUM" != "$ACTUAL_CHECKSUM" ] | ||
then | ||
>&2 echo 'ERROR: Invalid installer checksum' | ||
rm composer-setup.php | ||
exit 1 | ||
fi | ||
|
||
php composer-setup.php --quiet | ||
RESULT=$? | ||
rm composer-setup.php | ||
exit $RESULT |