diff --git a/stubs/docker/octane.Dockerfile.stub b/stubs/docker/octane.Dockerfile.stub index 4d01316..47fe518 100644 --- a/stubs/docker/octane.Dockerfile.stub +++ b/stubs/docker/octane.Dockerfile.stub @@ -15,12 +15,14 @@ FROM php:${PHP_VERSION}-cli-alpine AS beacon WORKDIR /var/www/html RUN apk add --no-cache \ + brotli-dev \ git \ icu-data-full \ icu-libs \ libstdc++ \ linux-headers \ oniguruma-dev \ + openssl-dev \ $PHPIZE_DEPS \ && pecl install swoole \ && docker-php-ext-enable swoole \ diff --git a/tests/Unit/Docker/DockerfileGeneratorTest.php b/tests/Unit/Docker/DockerfileGeneratorTest.php index d32f4eb..9cb77ce 100644 --- a/tests/Unit/Docker/DockerfileGeneratorTest.php +++ b/tests/Unit/Docker/DockerfileGeneratorTest.php @@ -36,8 +36,15 @@ ); $contents = $generator->render($configuration); + $matched = preg_match('/RUN apk add --no-cache\s+(.+?)\s+&& pecl install swoole/s', $contents, $matches); - expect($contents)->toContain('pecl install swoole') + expect($matched)->toBe(1); + + $apkAddBlock = $matches[1]; + + expect($apkAddBlock)->toContain('brotli-dev') + ->and($apkAddBlock)->toContain('openssl-dev') + ->and($contents)->toContain('pecl install swoole') ->and($contents)->toContain('LABEL io.devoption.beacon.runtime="octane"') ->and($contents)->toContain('EXPOSE 8000') ->and($contents)->toContain('CMD ["php", "artisan", "octane:start", "--server=swoole", "--host=0.0.0.0", "--port=8000"]');