#Using Laravel Nightwatch with Docker
1 messages · Page 1 of 1 (latest)
Try setting NIGHTWATCH_INGEST_URI=nightwatch:2407
https://nightwatch.laravel.com/docs/agent/advanced-configuration#customizing-the-agent-port
This could actually work out 🤔
Let me know if it works?
somehow it did not :/
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.
All good. I added Supervisor to my Dockerfile and now I'm running Horizon, Nightwatch & Scheduler with Supervisor. 👍
so what ultimately needs to be written in env and in docker compose?
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).
Don't know. If all the containers are on the same network, they ought to be able to resolve each other's IP's. Perhaps you could try adding explicit aliases in docker-compose?
Haven't tried it myself yet. Waiting for the ability to have fine grained control of what gets sampled. Consumed our 20M event quota in less than 24 hours, even with request sample rate set to 0.01