Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions stubs/docker/octane.Dockerfile.stub
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
9 changes: 8 additions & 1 deletion tests/Unit/Docker/DockerfileGeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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"]');
Expand Down
Loading