Skip to content

Commit

Permalink
(yiisoft#27) Added Docker
Browse files Browse the repository at this point in the history
  • Loading branch information
s1lver committed Mar 17, 2023
1 parent 600ea81 commit 7b95452
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 3 deletions.
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,5 @@ composer.lock
# PHP CS Fixer
.php_cs.cache

# Env variables
.env

# PHPUnit
.phpunit.result.cache
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
COMPOSE_PROJECT_NAME=yii-queue
COMPOSE_FILE=tests/docker-compose.yml

build:
COMPOSE_FILE=tests/docker/docker-compose.yml docker-compose up -d --build

test: test72 test71 test70 test56
test72:
docker-compose build php72
Expand Down
14 changes: 14 additions & 0 deletions tests/docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: '3.8'

services:
php80:
container_name: yii-queue-php80
build:
context: ../..
dockerfile: tests/docker/php/Dockerfile
args:
PHP_VERSION: '8.0'
volumes:
- ../runtime/.composer80:/root/.composer
- ../..:/var/www

9 changes: 9 additions & 0 deletions tests/docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

set -eu

flock tests/runtime/composer-install.lock composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi

php --version
set -x
exec "$@"
14 changes: 14 additions & 0 deletions tests/docker/php/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
ARG PHP_VERSION
FROM php:${PHP_VERSION}-fpm-alpine

RUN apk add autoconf g++ make

RUN pecl install pcov
RUN docker-php-ext-enable pcov

COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
ENV COMPOSER_ALLOW_SUPERUSER 1

WORKDIR /var/www

CMD ["sleep", "infinity"]

0 comments on commit 7b95452

Please sign in to comment.