Skip to content

Commit

Permalink
ADDED - docker
Browse files Browse the repository at this point in the history
  • Loading branch information
bartko-s committed Jun 1, 2019
1 parent eb7c4c8 commit 895e426
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.idea
/vendor/
/composer.lock
/tests/temp/
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@
}
},
"scripts": {
"test": "vendor/bin/phpunit --configuration tests/phpunit.xml"
"test": "vendor/bin/phpunit --configuration tests/phpunit.xml --coverage-clover tests/clover.xml"
}
}
8 changes: 8 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: '3.7'
services:
php:
build: docker
expose:
- 9000
volumes:
- .:/var/src/
30 changes: 30 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM php:7.3

RUN apt-get update

RUN apt-get install -y \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install -j$(nproc) gd

RUN docker-php-ext-enable opcache

RUN pecl install xdebug \
&& docker-php-ext-enable xdebug

RUN apt-get install libzip-dev -y \
&& docker-php-ext-install zip

RUN apt-get install unzip

RUN cd ~ \
&& curl -sS https://getcomposer.org/installer -o composer-setup.php \
&& php composer-setup.php --install-dir=/usr/local/bin --filename=composer
# composer cache persmission fix
RUN chmod a+w /var/www

COPY php.ini /usr/local/etc/php/

WORKDIR /var/src/
12 changes: 12 additions & 0 deletions docker/php.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
short_open_tag=Off
display_errors=On
display_startup_errors=On
error_reporting=E_ALL

opcache.max_accelerated_files = 20000
realpath_cache_size=4096K
realpath_cache_ttl=600

xdebug.remote_enable=true
xdebug.remote_port=9000
xdebug.remote_connect_back=1
3 changes: 3 additions & 0 deletions tests/StefanoImageTest/ImageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -345,5 +345,8 @@ public function testCreteTargetDirectoryIfNotExists() {
->save($targetPath, $newName);

$this->assertDirectoryExists($targetPath);

@rmdir(__DIR__ . '/assets/temp/this-dir/does-not-exists');
@rmdir(__DIR__ . '/assets/temp/this-dir');
}
}

0 comments on commit 895e426

Please sign in to comment.