File tree Expand file tree Collapse file tree 3 files changed +19
-13
lines changed Expand file tree Collapse file tree 3 files changed +19
-13
lines changed Original file line number Diff line number Diff line change 1- ARG PHP_VERSION=8.0
2- ARG COMPOSER_VERSION=2.0
1+ ARG PHP_VERSION=8.1
2+ ARG COMPOSER_VERSION=2.5.4
33
4- FROM composer:${COMPOSER_VERSION}
54FROM php:${PHP_VERSION}-cli
65
76RUN apt-get update && \
@@ -10,6 +9,16 @@ RUN apt-get update && \
109 pecl install xdebug && docker-php-ext-enable xdebug && \
1110 docker-php-ext-install -j$(nproc) pdo_mysql zip
1211
13- COPY --from=composer /usr/bin/composer /usr/local/bin/composer
12+ COPY --from=composer:${COMPOSER_VERSION} /usr/bin/composer /usr/local/bin/composer
1413
1514WORKDIR /code
15+
16+ COPY composer.* ./
17+
18+ RUN composer install
19+
20+ COPY ./ ./
21+
22+ RUN composer install
23+
24+ CMD ["./vendor/bin/phpunit" ]
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ version: '3'
33services :
44 tests :
55 container_name : tests
6+ tty : true
67 build :
78 context : .
89 dockerfile : Dockerfile
@@ -15,20 +16,16 @@ services:
1516
1617 mysql :
1718 container_name : mysql
18- image : mysql:5.7
19+ image : mysql:8.0
1920 ports :
20- - 3306:3306
21+ - " 3306:3306"
2122 environment :
2223 MYSQL_ROOT_PASSWORD :
2324 MYSQL_DATABASE : unittest
2425 MYSQL_ALLOW_EMPTY_PASSWORD : ' yes'
25- logging :
26- driver : none
2726
2827 mongodb :
2928 container_name : mongodb
30- image : mongo
29+ image : mongo:latest
3130 ports :
32- - 27017:27017
33- logging :
34- driver : none
31+ - " 27017:27017"
Original file line number Diff line number Diff line change 3838 </testsuite >
3939 </testsuites >
4040 <php >
41- <env name =" MONGODB_URI" value =" mongodb://127.0.0.1 /" />
41+ <env name =" MONGODB_URI" value =" mongodb://mongodb /" />
4242 <env name =" MONGODB_DATABASE" value =" unittest" />
4343 <env name =" MYSQL_HOST" value =" mysql" />
4444 <env name =" MYSQL_PORT" value =" 3306" />
You can’t perform that action at this time.
0 commit comments