File tree Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -12,9 +12,8 @@ install:
12
12
- docker version
13
13
- sudo pip install docker-compose
14
14
- docker-compose version
15
- - sed -i -e "s/php:cli/php:${TRAVIS_PHP_VERSION}-cli/g" Dockerfile
16
15
- cat Dockerfile
17
- - docker-compose build
16
+ - docker-compose build --build-arg PHP_VERSION=${TRAVIS_PHP_VERSION}
18
17
19
18
script :
20
19
- docker-compose up --exit-code-from php
Original file line number Diff line number Diff line change 1
- FROM php:cli
1
+ ARG PHP_VERSION
2
+
3
+ FROM php:${PHP_VERSION}-cli
2
4
3
5
RUN pecl install xdebug
4
6
5
7
RUN apt-get update && \
6
- apt-get install -y autoconf pkg-config libssl-dev git && \
7
- pecl install mongodb git zlib1g-dev && docker-php-ext-enable mongodb && \
8
+ apt-get install -y autoconf pkg-config libssl-dev git zlib1g-dev
9
+
10
+ RUN pecl install mongodb && docker-php-ext-enable mongodb && \
8
11
docker-php-ext-install -j$(nproc) pdo pdo_mysql zip && docker-php-ext-enable xdebug
9
12
10
13
RUN curl -sS https://getcomposer.org/installer | php \
Original file line number Diff line number Diff line change 1
1
version : ' 3'
2
2
3
3
services :
4
-
5
4
php :
6
5
container_name : php
7
6
build :
@@ -10,6 +9,8 @@ services:
10
9
volumes :
11
10
- .:/code
12
11
working_dir : /code
12
+ environment :
13
+ PHP_VERSION : 7.1
13
14
command : bash -c "composer install --prefer-source --no-interaction && php ./vendor/bin/phpunit"
14
15
depends_on :
15
16
- mysql
You can’t perform that action at this time.
0 commit comments