Add Swoole + Laravel Octane Support #72
Replies: 9 comments 8 replies
-
Just adding a note that @fideloper added a PR for one of his projects using Octane. This might be a good thing to reference and bring back into the project natively: superfly/flyctl#1143 |
Beta Was this translation helpful? Give feedback.
-
I'm running Octane in production. At the moment I'm using RoadRunner, but Swoole is also good! Due to personal preference, I ended up building my own images in Alpine, but it may be useful for your research. Let me know if there's anything I could help with and I will try to answer to the best of my abilities 🙌 |
Beta Was this translation helpful? Give feedback.
-
Having support for Octane with Swoole would be awesome. Thanks for the good work @jaydrogers 🙌🏼 |
Beta Was this translation helpful? Give feedback.
-
that would be nice to do , i would love to have alpine version of laravel octane on swoole . |
Beta Was this translation helpful? Give feedback.
-
We're waiting for this :^), already using the [email protected] and very satified |
Beta Was this translation helpful? Give feedback.
-
Up! Hope you will add such feature.. We really need it! |
Beta Was this translation helpful? Give feedback.
-
Just putting another post in here to say that this would be an amazing addition! |
Beta Was this translation helpful? Give feedback.
-
any news/plans about this ? we really want to use spin pro but we relay on Laravel Octane. |
Beta Was this translation helpful? Give feedback.
-
FYI, this is my Dockerfile that runs octane in FROM serversideup/php:8.4-fpm-nginx
USER root
RUN install-php-extensions openswoole
RUN sed -i 's|try_files .*;|try_files $uri $uri/ @octane;|g' /etc/nginx/site-opts.d/*.conf.template
RUN sed -i 's|fastcgi_pass .*;|try_files /.well-known/dummy @octane;|g' /etc/nginx/site-opts.d/*.conf.template
RUN printf SIGINT > /etc/s6-overlay/s6-rc.d/php-fpm/down-signal
USER www-data
COPY --chmod=0755 --chown=root:root <<'EOF' /etc/s6-overlay/s6-rc.d/php-fpm/run
#!/command/execlineb -P
with-contenv
s6-notifyoncheck -d
/usr/local/bin/php /var/www/html/artisan octane:start --port=9000
EOF
COPY --chmod=0755 --chown=root:root <<'EOF' /usr/local/bin/php-fpm-healthcheck
#!/bin/sh
/usr/local/bin/php /var/www/html/artisan octane:status
EOF
COPY --chmod=0755 --chown=root:root <<'EOF' /usr/local/bin/nginx-healthcheck
#!/bin/sh
curl --insecure --silent --location --show-error --fail http://localhost:8080$HEALTHCHECK_PATH
EOF
COPY --chown=www-data:www-data <<'EOF' /etc/nginx/conf.d/connection_upgrade.conf
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
EOF
COPY --chown=www-data:www-data <<'EOF' /etc/nginx/server-opts.d/octane.conf
location @octane {
set $suffix "";
if ($uri = /index.php) {
set $suffix ?$query_string;
}
proxy_http_version 1.1;
proxy_set_header Host $http_host;
proxy_set_header Scheme $scheme;
proxy_set_header SERVER_PORT $server_port;
proxy_set_header REMOTE_ADDR $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_pass http://127.0.0.1:9000$suffix;
}
EOF
COPY --chown=www-data:www-data <<'EOF' /etc/nginx/server-opts.d/healthcheck-octane.conf
location /healthcheck-octane {
access_log off;
return 200 "OK";
}
EOF
ENV HEALTHCHECK_PATH="/healthcheck-octane"
HEALTHCHECK --interval=5s --timeout=3s --retries=3 \
CMD [ "sh", "-c", "nginx-healthcheck && php-fpm-healthcheck || exit 1" ] Looks like it would be much easier with |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Background
Solution
Beta Was this translation helpful? Give feedback.
All reactions