Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document how to run PHP servers directly #291

Open
yrro opened this issue Jun 15, 2020 · 0 comments
Open

Document how to run PHP servers directly #291

yrro opened this issue Jun 15, 2020 · 0 comments

Comments

@yrro
Copy link

yrro commented Jun 15, 2020

I was looking for the best way to launch a PHP script which is itself a long-lived server process.

Rather than replacing the S2I run script entirely, I created a php-pre-start/99-artisan-ws.sh script:

#!/bin/bash

# This script is sourced by the s2i run script just before Apache httpd would
# be executed. If the ARTISAN_WS environment variable is set then the
# WebSocket server is launched instead of Apache httpd.

if [[ -z $ARTISAN_WS ]]; then
    return 0
fi

exec php artisan websockets:serve

# If we reach this point, we weren't able to run the WebSocket server. We want
# the container to die rather than continue to run Apache httpd.
exit 1

If that looks sane then how about documenting this approach?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant