Fixing docker images for running local test suites

This commit is contained in:
Paul Dragoonis 2024-12-03 14:48:06 +00:00
parent 7187f1d3e5
commit b409c56cc6
2 changed files with 23 additions and 9 deletions

10
.docker/test/Dockerfile Normal file
View file

@ -0,0 +1,10 @@
FROM ghcr.io/sylius/sylius-php:8.2-fixuid-xdebug-alpine
USER root
RUN apk add --update apk add nano \
# for all test commands, they use makefile
make \
# for the integration tests, they need the frontend running
nodejs npm yarn
USER sylius

View file

@ -1,21 +1,25 @@
services: services:
static: static:
image: sylius/standard:1.11-traditional build:
dockerfile: .docker/test/Dockerfile
context: .
entrypoint: ["make", "static"] entrypoint: ["make", "static"]
profiles: ["static-analyze"] profiles: ["static-analyze"]
environment: environment:
APP_ENV: "test_cached" APP_ENV: "test_cached"
PHP_DATE_TIMEZONE: "Europe/Warsaw" PHP_DATE_TIMEZONE: "Europe/Warsaw"
volumes: volumes:
- ./:/app:delegated - ./:/srv/sylius:delegated
- ./.docker/test/php.ini:/etc/php/8.0/fpm/php.ini:delegated - .docker/test/php.ini:/etc/php/8.2/fpm/php.ini:delegated
- ./.docker/test/php.ini:/etc/php/8.0/cli/php.ini:delegated - .docker/test/php.ini:/usr/local/etc/php/php-cli.ini:delegated
networks: networks:
- sylius - sylius
behat: behat:
image: sylius/standard:1.11-traditional build:
entrypoint: ["make", "integration"] dockerfile: .docker/test/Dockerfile
context: .
entrypoint: ["make", "phpunit-integration"]
profiles: ["integration"] profiles: ["integration"]
environment: environment:
APP_ENV: "test_cached" APP_ENV: "test_cached"
@ -27,9 +31,9 @@ services:
SYLIUS_MESSENGER_TRANSPORT_CATALOG_PROMOTION_REMOVAL_DSN: "sync://" SYLIUS_MESSENGER_TRANSPORT_CATALOG_PROMOTION_REMOVAL_DSN: "sync://"
SYLIUS_MESSENGER_TRANSPORT_CATALOG_PROMOTION_REMOVAL_FAILED_DSN: "sync://" SYLIUS_MESSENGER_TRANSPORT_CATALOG_PROMOTION_REMOVAL_FAILED_DSN: "sync://"
volumes: volumes:
- ./:/app:delegated - ./:/srv/sylius:delegated
- ./.docker/test/php.ini:/etc/php/8.0/fpm/php.ini:delegated - .docker/test/php.ini:/etc/php/8.2/fpm/php.ini:delegated
- ./.docker/test/php.ini:/etc/php/8.0/cli/php.ini:delegated - .docker/test/php.ini:/usr/local/etc/php/php-cli.ini:delegated
depends_on: depends_on:
- mysql - mysql
networks: networks: