Skip to content

Commit

Permalink
[Tests] php install failure (Docker) (aces#8239)
Browse files Browse the repository at this point in the history
Fix Docker image when run locally

GitHub Actions replaces the PHP version in the docker image, but the default version is too old to run LORIS when not replaced by GitHub Actions.

This upgrades the default version so that tests can be run locally without modifying the Docker image.
  • Loading branch information
laemtl committed Nov 29, 2022
1 parent 13cd3b0 commit ad0460c
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 16 deletions.
12 changes: 0 additions & 12 deletions Dockerfile.test.php7.debug

This file was deleted.

2 changes: 1 addition & 1 deletion Dockerfile.test.php8
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM php:8.0
FROM php:8.1

RUN apt-get update && \
apt-get install -y mariadb-client libzip-dev
Expand Down
13 changes: 13 additions & 0 deletions Dockerfile.test.php8.debug
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM php:8.1

RUN apt-get update && \
apt-get install -y mariadb-client libzip-dev

RUN yes | pecl install xdebug-3.1.0
RUN echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini
RUN echo "xdebug.mode=debug" >> /usr/local/etc/php/conf.d/xdebug.ini
RUN echo "xdebug.start_with_request=yes" >> /usr/local/etc/php/conf.d/xdebug.ini

# Install extensions through the scripts the container provides
RUN apt-get install -y libzip-dev zip && \
docker-php-ext-install pdo_mysql zip
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ services:
web-debug:
build:
context: .
dockerfile: Dockerfile.test.php7.debug
dockerfile: Dockerfile.test.php8.debug
volumes:
- ./:/app
- ./test/test_instrument:/app/project/instruments
Expand All @@ -88,7 +88,7 @@ services:
unit-tests-debug:
build:
context: .
dockerfile: Dockerfile.test.php7.debug
dockerfile: Dockerfile.test.php8.debug
volumes:
- ./:/app
working_dir: /app
Expand All @@ -103,7 +103,7 @@ services:
integration-tests-debug:
build:
context: .
dockerfile: Dockerfile.test.php7.debug
dockerfile: Dockerfile.test.php8.debug
volumes:
- ./:/app
working_dir: /app
Expand Down

0 comments on commit ad0460c

Please # to comment.