8000 fix(docker): publish the dev sensor ports on this machine only by adeelahmad · Pull Request #204 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions docker-compose.yml
8000
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,11 @@ services:
command: lens worker
# the sensor hub (docs/sensors.md): MQTT and syslog, listened on only once sensors are turned on in the app.
# Something else on this machine using 1883 or 5514? Set LENS_MQTT_PORT / LENS_SYSLOG_PORT to other ports.
# Only this machine reaches them while developing; LENS_SENSOR_BIND=0.0.0.0 lets devices on the network in.
ports:
- "${LENS_MQTT_PORT:-1883}:1883"
- "${LENS_SYSLOG_PORT:-5514}:5514/udp"
- "${LENS_SYSLOG_PORT:-5514}:5514/tcp"
- "${LENS_SENSOR_BIND:-127.0.0.1}:${LENS_MQTT_PORT:-1883}:1883"
- "${LENS_SENSOR_BIND:-127.0.0.1}:${LENS_SYSLOG_PORT:-5514}:5514/udp"
- "${LENS_SENSOR_BIND:-127.0.0.1}:${LENS_SYSLOG_PORT:-5514}:5514/tcp"
healthcheck:
disable: true

Expand Down
4 changes: 3 additions & 1 deletion docs/sensors.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ on its own, waiting longer each time up to five minutes. Change its connection w
pause it to disconnect. One process runs each bridge.

In Docker, the hub runs in the `worker` container, which publishes 1883 and 5514; set `LENS_MQTT_PORT` or
`LENS_SYSLOG_PORT` when something else on the machine has those ports. Run natively, it runs in `lens worker` (and in
`LENS_SYSLOG_PORT` when something else on the machine has those ports. The development compose file
(`docker-compose.yml`) publishes them on this machine only; set `LENS_SENSOR_BIND=0.0.0.0` to let devices on the
network reach them. Run natively, it runs in `lens worker` (and in
the API when it runs background work). Several processes can run it: the first to get the port serves it, and the
others try again every minute.

Expand Down
Loading
0