One Ubuntu server with staging and production environment - Soketi websocket server docker setup
When having multiple Laravel environments on the same server. Is it best practice to have a compose.yml per Laravel environment (staging and production). Or would it be better practice to have a separate environment for Soketi in the "/srv" folder. For example "/srv/soketi-websocket-server" where we would have a single compose.yml and .env file?
You should never keep both prod and staging on the same server, you should keep them on their own, if your host fails you will lose both, so my advice is to keep them seperate.
@tray2 thank you.
Yes, when the time is right we will have multiple servers or just nightly builds of docker images which can be deployed anywhere in case of emergency.
There are many docker installation options for soketi including Laravel Sail, but because we are not using Laravel Sail currently, the setup will be as follows:
Each environment on the server, staging and production, will have their own soketi server docker container. It will be defined by resources/docker/soketi/compose.yml and will be using the standard Laravel .env file for each environment. This way we will be able to change the soketi image version on staging while production keeps running. Also the compose.yml will go into the project git repository so it is tracked within the project.
Any tips, tricks or hints for the suggested setup?