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

joseoca's avatar

Octane docker microservice

Hey, I'm setting up a laravel octane microservices with swoole, each runs on it's own docker container with supervisor, in some services we are using octane+queues.. so supervisor starts the octane server and the queue workers. The issues is that if we want to start 2 services on the same machine, different containers, the second octane fails to start saying the port 8000 is already in use:

InvalidArgumentException

Unable to start server. Port 8000 is already in use.

at vendor/laravel/octane/src/Commands/Concerns/InteractsWithServers.php:165 161▕ 162▕ if (is_resource($connection)) { 163▕ @fclose($connection); 164▕ ➜ 165▕ throw new InvalidArgumentException("Unable to start server. Port {$port} is already in use."); 166▕ } 167▕ } 168▕ 169▕ /**

  +26 vendor frames 

but we are not binding any container port with the host, this containers should work independent of each other and communicate through the container_ip:port.

Thanks in advance,

-- Jose

0 likes
1 reply
jlrdw's avatar

There are several good past post on microservices. I suggest read some and first decide if microservices is right for your needs. Usually the answer is no.

Please or to participate in this conversation.