#Using Laravel Nightwatch with Docker

1 messages · Page 1 of 1 (latest)

night wind
#

Hey,

I just found out that Laravel Nightwatch is live and wondered how I can run it with Docker?

Currently I'm running a few containers, e.g.

  • app
  • horizon
  • scheduler

I thought I could add nightwatch as a container but it wouldn't recognise any Events or Errors.

So: What's the recommended way?

grim compass
night wind
#

This could actually work out 🤔

grim compass
night wind
#

somehow it did not :/

grim compass
#

All the containers are on the same docker network, right?

Might be worth trying to forward the nightwatch container's port 2407 to the host, and run with host.docker.internal:2407 as ingest.

#

And you're not running with cached config from before changing the ingest?

#

Just checked the nightwatch config. You have to also set NIGHTWATCH_SERVER=nightwatch or run the agent with --server=nightwatch.

Unfortunately I can't see what that value is used for since the agent is a phar file.

night wind
#

All good. I added Supervisor to my Dockerfile and now I'm running Horizon, Nightwatch & Scheduler with Supervisor. 👍

radiant turret
#

so what ultimately needs to be written in env and in docker compose?

radiant turret
#

Is this how it should be or not?

"NIGHTWATCH_INGEST_URI": "nightwatch:2407",
"NIGHTWATCH_SERVER": "nightwatch:2407",

nightwatch:
<<: *laravel
command: ["php", "artisan", "nightwatch:agent", "--listen-on=127.0.0.1:2407"]
ports:
- 127.0.0.1:2407:2407

#

/app # php artisan nightwatch:status

ERROR stream_socket_client(): Unable to connect to tcp://nightwatch:2407 (Connection refused).

grim compass