Skip to content

Commit c51c19e

Browse files
committed
add roadrunner sail docs
1 parent 984c9a8 commit c51c19e

File tree

1 file changed

+40
-1
lines changed

1 file changed

+40
-1
lines changed

README.md

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,45 @@ Finally, specify your preferred application server (`roadrunner` or `swoole`) in
6060

6161
RoadRunner is powered by the RoadRunner binary, which is built using Go. The first time you start a RoadRunner based Octane server, Octane will offer to download and install the RoadRunner binary for you.
6262

63+
##### RoadRunner Via Laravel Sail
64+
65+
If you plan to develop your application using [Laravel Sail](https://laravel.com/docs/sail), you should run the following commands to install Octane and RoadRunner:
66+
67+
```bash
68+
./vendor/bin/sail up
69+
70+
./vendor/bin/sail composer require spiral/roadrunner
71+
```
72+
73+
Next, you should start a Sail shell and use the `rr` executable to retrieve the latest Linux based build of the RoadRunner binary:
74+
75+
```bash
76+
./vendor/bin/sail shell
77+
78+
# Within the Sail shell...
79+
./vendor/bin/rr get-binary
80+
```
81+
82+
After installing the RoadRunner binary, you may exit your Sail shell session. You will now need to adjust the `supervisor.conf` file used by Sail to keep your application running. To get started, execute the `sail:publish` Artisan command:
83+
84+
```bash
85+
./vendor/bin/sail artisan sail:publish
86+
```
87+
88+
Next, update the `command` directive of your application's `docker/supervisord.conf` file so that Sail serves your application using Octane instead of the PHP development server:
89+
90+
```ini
91+
command=/usr/bin/php -d variables_order=EGPCS /var/www/html/artisan octane:start --server=roadrunner --host=0.0.0.0 --port=80
92+
```
93+
94+
Next, ensure the `rr` binary is executable and build your Sail images:
95+
96+
```bash
97+
chmod +x ./rr
98+
99+
./vendor/bin/sail build
100+
```
101+
63102
#### Swoole
64103

65104
If you plan to use the Swoole application server to serve your Laravel Octane application, you must install the Swoole PHP extension. Typically, this can be done via PECL:
@@ -75,7 +114,7 @@ pecl install swoole
75114
Alternatively, you may develop your Swoole based Octane application using [Laravel Sail](https://laravel.com/docs/sail), the official Docker based development environment for Laravel. Laravel Sail includes the Swoole extension by default. However, you will still need to adjust the `supervisor.conf` file used by Sail to keep your application running. To get started, execute the `sail:publish` Artisan command:
76115

77116
```bash
78-
php artisan sail:publish
117+
./vendor/bin/sail artisan sail:publish
79118
```
80119

81120
Next, update the `command` directive of your application's `docker/supervisord.conf` file so that Sail serves your application using Octane instead of the PHP development server:

0 commit comments

Comments
 (0)