Skip to content

Commit 7b95452

Browse files
committed
(yiisoft#27) Added Docker
1 parent 600ea81 commit 7b95452

File tree

5 files changed

+41
-3
lines changed

5 files changed

+41
-3
lines changed

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,5 @@ composer.lock
1717
# PHP CS Fixer
1818
.php_cs.cache
1919

20-
# Env variables
21-
.env
22-
20+
# PHPUnit
2321
.phpunit.result.cache

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
COMPOSE_PROJECT_NAME=yii-queue
22
COMPOSE_FILE=tests/docker-compose.yml
33

4+
build:
5+
COMPOSE_FILE=tests/docker/docker-compose.yml docker-compose up -d --build
6+
47
test: test72 test71 test70 test56
58
test72:
69
docker-compose build php72

tests/docker/docker-compose.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: '3.8'
2+
3+
services:
4+
php80:
5+
container_name: yii-queue-php80
6+
build:
7+
context: ../..
8+
dockerfile: tests/docker/php/Dockerfile
9+
args:
10+
PHP_VERSION: '8.0'
11+
volumes:
12+
- ../runtime/.composer80:/root/.composer
13+
- ../..:/var/www
14+

tests/docker/entrypoint.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/sh
2+
3+
set -eu
4+
5+
flock tests/runtime/composer-install.lock composer update --prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi
6+
7+
php --version
8+
set -x
9+
exec "$@"

tests/docker/php/Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
ARG PHP_VERSION
2+
FROM php:${PHP_VERSION}-fpm-alpine
3+
4+
RUN apk add autoconf g++ make
5+
6+
RUN pecl install pcov
7+
RUN docker-php-ext-enable pcov
8+
9+
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
10+
ENV COMPOSER_ALLOW_SUPERUSER 1
11+
12+
WORKDIR /var/www
13+
14+
CMD ["sleep", "infinity"]

0 commit comments

Comments
 (0)