From 2405baa3435b90f3772e1f845a0b9cb9e25176ac Mon Sep 17 00:00:00 2001 From: Olivier Laviale Date: Mon, 31 May 2021 20:35:00 +0200 Subject: [PATCH] Add Docker support for development --- Dockerfile | 11 ++++++----- Makefile | 7 +++---- docker-compose.yml | 4 +++- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index f71ce13..d2acbab 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,8 +2,8 @@ FROM php:7.2-cli-buster RUN apt-get update && \ apt-get install -y autoconf pkg-config && \ - pecl channel-update pecl.php.net && \ - pecl install xdebug && \ + pecl channel-update pecl.php.net && \ + pecl install xdebug && \ docker-php-ext-enable opcache xdebug RUN echo '\ @@ -13,13 +13,14 @@ xdebug.start_with_request=yes\n\ ' >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini RUN echo '\ +display_errors=On\n\ +error_reporting=E_ALL\n\ date.timezone=UTC\n\ ' >> /usr/local/etc/php/conf.d/php.ini -ENV PHP_IDE_CONFIG serverName=icanboogie-session-tests ENV COMPOSER_ALLOW_SUPERUSER 1 RUN apt-get update && \ apt-get install unzip && \ - curl -s https://raw.githubusercontent.com/composer/getcomposer.org/76a7060ccb93902cd7576b67264ad91c8a2700e2/web/installer | php -- --quiet && \ - mv composer.phar /usr/local/bin/composer + curl -s https://raw.githubusercontent.com/composer/getcomposer.org/76a7060ccb93902cd7576b67264ad91c8a2700e2/web/installer | php -- --quiet && \ + mv composer.phar /usr/local/bin/composer diff --git a/Makefile b/Makefile index cc7c98a..ab8fea9 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,6 @@ # customization PACKAGE_NAME = icanboogie/session -PACKAGE_VERSION = 3.0 PHPUNIT = vendor/bin/phpunit # do not edit the following lines @@ -11,11 +10,11 @@ usage: @echo "test: Runs the test suite.\ndoc: Creates the documentation.\nclean: Removes the documentation, the dependencies and the Composer files." vendor: - @COMPOSER_ROOT_VERSION=$(PACKAGE_VERSION) composer install + @composer install .PHONY: update update: - @COMPOSER_ROOT_VERSION=$(PACKAGE_VERSION) composer update + @composer update test-dependencies: vendor @@ -44,7 +43,7 @@ doc: vendor @apigen generate \ --source lib \ --destination build/docs/ \ - --title "$(PACKAGE_NAME) v$(PACKAGE_VERSION)" \ + --title "$(PACKAGE_NAME)" \ --template-theme "bootstrap" .PHONY: clean diff --git a/docker-compose.yml b/docker-compose.yml index 7456271..bb2166c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,7 +3,9 @@ version: "3.2" services: app: build: . + environment: + PHP_IDE_CONFIG: 'serverName=icanboogie-session-tests' volumes: - .:/app:delegated - - ~/.composer:/root/.composer + - ~/.composer:/root/.composer:delegated working_dir: /app