Closed arnoldski closed 1 year ago
Containers are meant to be one service per container - you're trying to run laravel-echo-server
alongside your application.
This is how I handle it in my application:
Note: I have a .lando
folder to store php.ini
config etc. This is also where the container is mounted and will write the laravel-echo-server.json
file to.
services:
echo-server:
type: compose
app_mount: false
myUser: root
services:
user: root
image: oanhnn/laravel-echo-server:3.1
command: /usr/local/bin/docker-entrypoint start
ports:
- 6001:6001
volumes:
- .lando/laravel-echo-server:/app
environment:
LANDO_NO_USER_PERMS: skip
I also explicitly set the host to specify the WS port
window.Echo = new Echo({
broadcaster: 'socket.io',
host: 'http://myapp.local:6001',
upgrade: false,
transports: ['websocket'],
});
It's also worth noting that I also have separate containers for node and Horizon. Both Horizion and echo-server use the same /app
codebase, but are run separately from the main application. A separation of concerns is one of the major benefits of Docker :)
services:
node:
type: node:10
port: 3000
overrides:
environment:
LANDO_NO_USER_PERMS: skip
worker:
type: php:7.4
via: cli
overrides:
command: [ "/bin/sh", "/lando-entrypoint.sh", "php", "artisan", "horizon" ]
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions and please check out this if you are wondering why we auto close issues.
We haven't heard anything here for about a year so we are automatically closing this issue to keep things tidy. If this is in error then please post in this thread and request the issue be reopened!
Hi,
I'm trying to launch the command
service supervisor start
on each launch of the container. On thebuild_as_root
step, this is executed as root and the service is running. On thepost-start
event, this is not executed as root and because of that the service is not running.How can I start (as root / sudo) this service each time I launch the application?
This is my
.lando.yml
file: