roadrunner support

This commit is contained in:
hakutaku
2025-08-17 12:30:14 +03:00
parent d7f8037a18
commit 89105cfb74
8 changed files with 1510 additions and 6 deletions

5
.gitignore vendored
View File

@@ -1,4 +1,3 @@
###> symfony/framework-bundle ###
/.env.local
/.env.local.php
@@ -8,3 +7,7 @@
/var/
/vendor/
###< symfony/framework-bundle ###
###> baldinof/roadrunner-bundle ###
/bin/rr
###< baldinof/roadrunner-bundle ###

28
.rr.dev.yaml Normal file
View File

@@ -0,0 +1,28 @@
version: "3"
server:
command: "php public/index.php"
env:
- APP_RUNTIME: Baldinof\RoadRunnerBundle\Runtime\Runtime
http:
address: 0.0.0.0:8080
middleware: [ "static", "gzip" ]
pool:
debug: true
uploads:
forbid: [ ".php", ".exe", ".bat" ]
static:
dir: "public"
forbid: [ ".php", ".htaccess" ]
logs:
mode: development
channels:
http:
level: debug # Log all http requests, set to info to disable
server:
level: info # Everything written to worker stderr is logged
mode: raw
metrics:
level: debug

37
.rr.yaml Normal file
View File

@@ -0,0 +1,37 @@
version: "3"
server:
command: "php public/index.php"
env:
- APP_RUNTIME: Baldinof\RoadRunnerBundle\Runtime\Runtime
http:
address: 0.0.0.0:8080
pool:
debug: false
middleware: [ "static", "gzip" ]
uploads:
forbid: [ ".php", ".exe", ".bat" ]
static:
dir: "public"
forbid: [ ".php", ".htaccess" ]
logs:
mode: production
channels:
http:
level: debug # Log all http requests, set to info to disable
server:
level: info # Everything written to worker stderr is logged
mode: raw
metrics:
level: error
# Uncomment to use metrics integration
# rpc:
# listen: tcp://127.0.0.1:6001
# Uncomment to use metrics integration
# metrics:
# # prometheus client address (path /metrics added automatically)
# address: "0.0.0.0:9180"

View File

@@ -7,6 +7,8 @@
"php": ">=8.2",
"ext-ctype": "*",
"ext-iconv": "*",
"baldinof/roadrunner-bundle": "^3.2",
"spiral/roadrunner-cli": "^2.7",
"symfony/console": "7.3.*",
"symfony/dotenv": "7.3.*",
"symfony/flex": "^2",
@@ -14,8 +16,6 @@
"symfony/runtime": "7.3.*",
"symfony/yaml": "7.3.*"
},
"require-dev": {
},
"config": {
"allow-plugins": {
"php-http/discovery": true,

1402
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -2,4 +2,5 @@
return [
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
Baldinof\RoadRunnerBundle\BaldinofRoadRunnerBundle::class => ['all' => true],
];

View File

@@ -0,0 +1,27 @@
baldinof_road_runner:
# When the kernel should be rebooted.
# See https://github.com/baldinof/roadrunner-bundle#kernel-reboots
kernel_reboot:
# if you want to use a fresh container on each request, use the `always` strategy
strategy: on_exception
# Exceptions you KNOW that do not put your app in an unrecoverable state
allowed_exceptions:
- Symfony\Component\HttpKernel\Exception\HttpExceptionInterface
- Symfony\Component\Serializer\Exception\ExceptionInterface
- Symfony\Contracts\HttpClient\Exception\ExceptionInterface
# Allow to send prometheus metrics to the main RoadRunner process,
# via a `Spiral\RoadRunner\MetricsInterface` service.
# See https://github.com/baldinof/roadrunner-bundle#metrics
metrics:
enabled: false
# collect:
# my_counter:
# type: counter
# help: Some help
# You can use middlewares to manipulate Symfony requests & responses.
# See https://github.com/baldinof/roadrunner-bundle#middlewares
# middlewares:
# - App\Middleware\YourMiddleware

View File

@@ -1,4 +1,16 @@
{
"baldinof/roadrunner-bundle": {
"version": "3.2",
"recipe": {
"repo": "github.com/symfony/recipes-contrib",
"branch": "main",
"version": "3.0",
"ref": "0da69c96650460102ed0a2a0004e5b347f7220c9"
},
"files": [
"config/packages/baldinof_road_runner.yaml"
]
},
"symfony/console": {
"version": "7.3",
"recipe": {