Skip to content

Commit

Permalink
Add Docker support for development
Browse files Browse the repository at this point in the history
  • Loading branch information
olvlvl committed May 31, 2021
1 parent 9eb1c79 commit 2405baa
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
11 changes: 6 additions & 5 deletions Dockerfile
Expand Up @@ -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 '\
Expand All @@ -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
7 changes: 3 additions & 4 deletions Makefile
@@ -1,7 +1,6 @@
# customization

PACKAGE_NAME = icanboogie/session
PACKAGE_VERSION = 3.0
PHPUNIT = vendor/bin/phpunit

# do not edit the following lines
Expand All @@ -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

Expand Down Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion docker-compose.yml
Expand Up @@ -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

0 comments on commit 2405baa

Please sign in to comment.