From e056253072fdaf779759658e07a22a0835026af3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emre=20=C3=87al=C4=B1=C5=9Fkan?= Date: Thu, 28 Dec 2023 23:46:47 +0300 Subject: [PATCH] Added docker files --- README.md | 8 ++++---- frankenphp.Dockerfile | 2 +- openswoole.Dockerfile | 2 -- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 0901c8e..404e749 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ ### OpenSwoole ```bash -docker run -p 9801:9801/tcp ghcr.io/thecaliskan/laravel-benchmark:openswoole +docker run --pull=always -p 9801:9801/tcp ghcr.io/thecaliskan/laravel-benchmark:openswoole wrk -t8 -c16 -d30s --latency http://127.0.0.1:9801/api/health-check ``` @@ -12,7 +12,7 @@ wrk -t8 -c16 -d30s --latency http://127.0.0.1:9801/api/health-check ### Swoole ```bash -docker run -p 9802:9802/tcp ghcr.io/thecaliskan/laravel-benchmark:swoole +docker run --pull=always -p 9802:9802/tcp ghcr.io/thecaliskan/laravel-benchmark:swoole wrk -t8 -c16 -d30s --latency http://127.0.0.1:9802/api/health-check ``` @@ -20,7 +20,7 @@ wrk -t8 -c16 -d30s --latency http://127.0.0.1:9802/api/health-check ### RoadRunner ```bash -docker run -p 9803:9803/tcp ghcr.io/thecaliskan/laravel-benchmark:roadrunner +docker run --pull=always -p 9803:9803/tcp ghcr.io/thecaliskan/laravel-benchmark:roadrunner wrk -t8 -c16 -d30s --latency http://127.0.0.1:9803/api/health-check ``` @@ -28,7 +28,7 @@ wrk -t8 -c16 -d30s --latency http://127.0.0.1:9803/api/health-check ### FrankenPHP ```bash -docker run -p 9804:9804/tcp ghcr.io/thecaliskan/laravel-benchmark:frankenphp +docker run --pull=always -p 9804:9804/tcp ghcr.io/thecaliskan/laravel-benchmark:frankenphp wrk -t8 -c16 -d30s --latency http://127.0.0.1:9804/api/health-check ``` diff --git a/frankenphp.Dockerfile b/frankenphp.Dockerfile index ea66190..b92dfde 100644 --- a/frankenphp.Dockerfile +++ b/frankenphp.Dockerfile @@ -11,7 +11,7 @@ WORKDIR /var/www RUN apk add jq -RUN wget -Ofrankenphp $(wget -O- https://api.github.com/repos/dunglas/frankenphp/releases/latest | jq '.assets[] | select(.name=="frankenphp-linux-x86_64") | .browser_download_url' -r) +RUN wget -O/usr/local/bin/frankenphp $(wget -O- https://api.github.com/repos/dunglas/frankenphp/releases/latest | jq '.assets[] | select(.name=="frankenphp-linux-x86_64") | .browser_download_url' -r) RUN composer install --no-dev diff --git a/openswoole.Dockerfile b/openswoole.Dockerfile index 734f076..6135e96 100644 --- a/openswoole.Dockerfile +++ b/openswoole.Dockerfile @@ -11,8 +11,6 @@ WORKDIR /var/www RUN composer install --no-dev -RUN composer env-generate - RUN php -r "file_exists('.env') || copy('.env.example', '.env');" && php artisan key:generate --ansi ENTRYPOINT ["php", "artisan", "octane:start", "--server=swoole", "--port=9801", "--workers=16", "--host=0.0.0.0"]