diff --git a/.env-example b/.env-example new file mode 100644 index 0000000..a4df111 --- /dev/null +++ b/.env-example @@ -0,0 +1 @@ +UID=1000 \ No newline at end of file diff --git a/.gitignore b/.gitignore index 31a345f..43b2d94 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ tests/_support tests/_output tests/cases/yii2-app-advanced/_data/db.sqlite +.env \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..bf3b009 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +ARG PHP_VERSION="8.3-alpine" + +FROM php:$PHP_VERSION + +ADD https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions /usr/local/bin/ + +RUN chmod +x /usr/local/bin/install-php-extensions \ + && apk add --no-cache git \ + && install-php-extensions gd intl zip intl pcov @composer + +WORKDIR /var/www/html \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..477f02d --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,39 @@ +services: + php8.0: &phpbase + user: ${UID:-1000} + volumes: + # Mount source-code for development + - ./:/var/www/html + env_file: + - .env + environment: + - XDEBUG_CONFIG=client_host=host.docker.internal + extra_hosts: + - "host.docker.internal:host-gateway" + build: + context: ./ + dockerfile: Dockerfile + args: + - PHP_VERSION=8.0-alpine + + php8.1: + <<: *phpbase + build: + args: + - PHP_VERSION=8.1-alpine + php8.2: + <<: *phpbase + build: + args: + - PHP_VERSION=8.2-alpine + + php8.3: + <<: *phpbase + build: + args: + - PHP_VERSION=8.3-alpine + php8.4: + <<: *phpbase + build: + args: + - PHP_VERSION=8.4-alpine \ No newline at end of file diff --git a/readme.md b/readme.md index 4040366..704251e 100644 --- a/readme.md +++ b/readme.md @@ -24,3 +24,11 @@ composer require "codeception/module-yii2" --dev `Codeception Module Yii2` is open-sourced software licensed under the [MIT](/LICENSE) License. © Codeception PHP Testing Framework + +## Test with docker-compose + +```bash +docker-compose run php8.4 composer install +docker-compose run php8.4 vendor/bin/codecept build +docker-compose run php8.4 vendor/bin/codecept run +```