diff --git a/.docker/test/Dockerfile b/.docker/test/Dockerfile new file mode 100644 index 0000000000..f92c736387 --- /dev/null +++ b/.docker/test/Dockerfile @@ -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 \ No newline at end of file diff --git a/docker-compose.test.yml b/docker-compose.test.yml index 2de0da4789..0dab2ec540 100644 --- a/docker-compose.test.yml +++ b/docker-compose.test.yml @@ -1,21 +1,25 @@ services: static: - image: sylius/standard:1.11-traditional + build: + dockerfile: .docker/test/Dockerfile + context: . entrypoint: ["make", "static"] profiles: ["static-analyze"] environment: APP_ENV: "test_cached" PHP_DATE_TIMEZONE: "Europe/Warsaw" volumes: - - ./:/app:delegated - - ./.docker/test/php.ini:/etc/php/8.0/fpm/php.ini:delegated - - ./.docker/test/php.ini:/etc/php/8.0/cli/php.ini:delegated + - ./:/srv/sylius:delegated + - .docker/test/php.ini:/etc/php/8.2/fpm/php.ini:delegated + - .docker/test/php.ini:/usr/local/etc/php/php-cli.ini:delegated networks: - sylius behat: - image: sylius/standard:1.11-traditional - entrypoint: ["make", "integration"] + build: + dockerfile: .docker/test/Dockerfile + context: . + entrypoint: ["make", "phpunit-integration"] profiles: ["integration"] environment: APP_ENV: "test_cached" @@ -27,9 +31,9 @@ services: SYLIUS_MESSENGER_TRANSPORT_CATALOG_PROMOTION_REMOVAL_DSN: "sync://" SYLIUS_MESSENGER_TRANSPORT_CATALOG_PROMOTION_REMOVAL_FAILED_DSN: "sync://" volumes: - - ./:/app:delegated - - ./.docker/test/php.ini:/etc/php/8.0/fpm/php.ini:delegated - - ./.docker/test/php.ini:/etc/php/8.0/cli/php.ini:delegated + - ./:/srv/sylius:delegated + - .docker/test/php.ini:/etc/php/8.2/fpm/php.ini:delegated + - .docker/test/php.ini:/usr/local/etc/php/php-cli.ini:delegated depends_on: - mysql networks: