Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

nrobates's avatar

Laravel Octane Watcher Issue on Docker Container

Hello!

I am running a docker container through docker-compose and on start up the container runs the following: php artisan octane:start --host=0.0.0.0 --watch. This works great and I see:

INFO  Server running…

  Local: http://0.0.0.0:8000 

  Press Ctrl+C to stop the server

Unfortunately anytime a change happens and the watcher detects the change I get the message Application change detected. Restarting workers…, and then the docker container stops.

Is anyone else experiencing this, or have any suggestions on how to prevent the watcher from causing the entire container to stop?

Any assistance is appreciated.

0 likes
6 replies
bugsysha's avatar

I run the container, enter the /bin/bash and run php artisan octane:start --host=0.0.0.0 --watch command. That way it doesn't happen.

nrobates's avatar

Unfortunately, that still does not seem to be a solution. For context, I changed it so the container simply boots up and I could ssh into the container and then run octane with the watcher. I should note, I have also added the usePolling: true to the fileWatcher.js file as per some comments about it in the discord channel and the results are the same as you will see in my example output below. Sometimes it is only one file change and other times it is a few, but unfortunately, and all too frequently, octane just stops during the workers being restarted.

/var/www/html # php artisan octane:start --host=0.0.0.0 --watch -vvv

   INFO  Server running…

  Local: http://0.0.0.0:8000

  Press Ctrl+C to stop the server


   INFO  Application change detected. Restarting workers…
/var/www/html # php artisan octane:start --host=0.0.0.0 --watch -vvv

   INFO  Server running…

  Local: http://0.0.0.0:8000

  Press Ctrl+C to stop the server


   INFO  Application change detected. Restarting workers…

   INFO  Application change detected. Restarting workers…

   INFO  Application change detected. Restarting workers…

   INFO  Application change detected. Restarting workers…
/var/www/html # php artisan octane:start --host=0.0.0.0 --watch -vvv

   INFO  Server running…

  Local: http://0.0.0.0:8000

  Press Ctrl+C to stop the server


   INFO  Application change detected. Restarting workers…

   INFO  Application change detected. Restarting workers…
/var/www/html #

I am at a loss here. Not sure what is happening.

bugsysha's avatar

For context, I changed it so the container simply boots up and I could ssh into the container and then run octane with the watcher

Yes, that is exactly what I suggested. Not sure how that didn't resolve your issue. Which OS?

nrobates's avatar

The container is running Alpine Linux. The container is not crashing now due to the change you suggested. However, Octane still stops when restarting workers. That is the actual issue that seems to be happening.

nrobates's avatar

@khovanskiy We solved this simply by putting it behind supervisor in the container so it will automatically restart once it gets into this state.

Please or to participate in this conversation.