Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zanbaldwin/runtime-playground
Demo of a new project using the new Runtime Symfony component (PHP-FPM, RoadRunner, and Swoole).
https://github.com/zanbaldwin/runtime-playground
component php runtime symfony
Last synced: 2 months ago
JSON representation
Demo of a new project using the new Runtime Symfony component (PHP-FPM, RoadRunner, and Swoole).
- Host: GitHub
- URL: https://github.com/zanbaldwin/runtime-playground
- Owner: zanbaldwin
- License: mit
- Created: 2021-06-02T11:23:43.000Z (over 3 years ago)
- Default Branch: develop
- Last Pushed: 2021-06-02T15:54:21.000Z (over 3 years ago)
- Last Synced: 2024-08-01T20:49:18.823Z (5 months ago)
- Topics: component, php, runtime, symfony
- Language: Shell
- Homepage:
- Size: 44.9 KB
- Stars: 17
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# This Project
This is a working example of Symfony's Runtime component.
Do not use this project, look through the code and pull out the parts you find interesting. Copy+paste is your friend.## Contains:
- Symfony v5.3 skeleton,
- Docker Stack for both FPM, Swoole and RoadRunner, and
- A handy Makefile for the SSL stuff.## How?
Depending on the Docker build target (`fpm`, `swoole`, or `roadrunner`) the PHP container does the following:
- For build target `fpm`:
- Execute `php-fpm --nodaemonize`
- `APP_RUNTIME` is set to `Symfony\Component\Runtime\SymfonyRuntime`
- For build target `swoole`:
- Execute `php "/public/index.php"`
- `APP_RUNTIME` is set to `Runtime\Swoole\Runtime`
- Environment variables `SWOOLE_HOST` and `SWOOLE_PORT` are set.
- For build target `roadrunner`
- Execute `/sbin/rr serve`
- `APP_RUNTIME` is set to `Runtime\RoadRunnerSymfonyNyholm\Runtime`
- `.rr.yaml` configuration file is created
In the Nginx container, build target `fpm` uses FastCGI, while build targets `swoole` and `roadrunner` use Reverse Proxy.## Setup Locally
- You will need [`git`](https://git-scm.com/), [`openssl`](https://www.openssl.org/),
[`make`](https://www.gnu.org/software/make/), and [`mkcert`](https://mkcert.dev/).
- Update values in `.env` (choose `fpm`, `swoole` or `roadrunner` for `${RUNTIME}`).
- `docker-compose build --pull`
- `make password`
- `make mock-ssl`
- `composer install` (or `bin/env composer install` to run it inside the PHP container)
- `docker-compose up -d`
- `mkcert -install`
- Go to `https://${DOMAIN}:${SSL_PORT}`## Production
You probably shouldn't use this for production, but if you did:
- `sudo mkdir -p "/etc/letsencrypt/challenges"`
- `docker-compose -f "docker-compose.yaml" run -d --name "acme" server nginx -c "/etc/nginx/acme.conf"`
- `sudo certbot certonly --webroot --webroot-path="/etc/letsencrypt/challenges" --cert-name="docker" -d "${YOUR_DOMAIN}"`
- `sudo openssl dhparam -out "/etc/letsencrypt/dhparam.pem" 4096`