-
Notifications
You must be signed in to change notification settings - Fork 44
docker compose example with included MQTT broker #306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sgunes-wirepas
wants to merge
1
commit into
master
Choose a base branch
from
docker-compose-with-mqtt
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
docker/docker-compose/single_transport_local_mqtt/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # Single transport with local MQTT broker example | ||
|
|
||
| This example is based on the [single transport example](../single_transport/README.md). | ||
| The configuration instructions from single transport can be followed. In this | ||
| example, the MQTT broker is added to the docker compose file as a container, so | ||
| you don't have to set up and configure an MQTT broker separately. | ||
|
|
||
| The MQTT broker is configured insecurely, therefore this example is mainly | ||
| intended for quickly setting up a gateway for development purposes. The broker | ||
| can be reached from TCP port 1883 and via websockets on port 9001. | ||
|
|
||
75 changes: 75 additions & 0 deletions
75
docker/docker-compose/single_transport_local_mqtt/docker-compose.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| volumes: | ||
| dbus-volume: | ||
|
|
||
| services: | ||
| dbus-service: | ||
| image: wirepas/gateway_dbus_service:${GATEWAY_TAG:-latest} | ||
| container_name: dbus | ||
| restart: always | ||
| volumes: | ||
| - type: volume | ||
| source: dbus-volume | ||
| target: /var/run/dbus | ||
| logging: | ||
| driver: journald | ||
|
|
||
|
|
||
| transport-service: | ||
| image: wirepas/gateway_transport_service:${GATEWAY_TAG:-latest} | ||
| container_name: transport-service | ||
| environment: | ||
| WM_SERVICES_MQTT_HOSTNAME: "mqtt-broker" | ||
| WM_SERVICES_MQTT_PORT: "1883" | ||
| WM_SERVICES_MQTT_FORCE_UNSECURE: "True" | ||
| # To be modified | ||
| WM_GW_ID: | ||
| WM_GW_MODEL: | ||
| WM_GW_VERSION: | ||
| restart: always | ||
| depends_on: | ||
| - dbus-service | ||
| - mqtt-broker | ||
| volumes: | ||
| - type: volume | ||
| source: dbus-volume | ||
| target: /var/run/dbus | ||
| logging: | ||
| driver: journald | ||
|
|
||
|
|
||
| sink-service: | ||
| image: wirepas/gateway_sink_service:${GATEWAY_TAG:-latest} | ||
| container_name: sink-service | ||
| restart: on-failure | ||
| depends_on: | ||
| - dbus-service | ||
| devices: | ||
| # To be modified | ||
| - <path to from_host>:/dev/mysink | ||
| environment: | ||
| WM_GW_SINK_BAUDRATE: | ||
| WM_GW_SINK_ID: | ||
| # Do not change (path of sink in container) | ||
| WM_GW_SINK_UART_PORT: /dev/mysink | ||
| volumes: | ||
| - type: volume | ||
| source: dbus-volume | ||
| target: /var/run/dbus | ||
| logging: | ||
| driver: journald | ||
|
|
||
|
|
||
| mqtt-broker: | ||
| image: eclipse-mosquitto:latest | ||
| container_name: mqtt-broker | ||
| restart: on-failure | ||
| volumes: | ||
| - type: bind | ||
| source: mosquitto_config/ | ||
| target: /mosquitto/config/ | ||
| ports: | ||
| - "1883:1883/tcp" | ||
| - "9001:9001/tcp" | ||
| logging: | ||
| driver: journald | ||
|
|
7 changes: 7 additions & 0 deletions
7
docker/docker-compose/single_transport_local_mqtt/mosquitto_config/mosquitto.conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| listener 1883 | ||
|
|
||
| listener 9001 | ||
| protocol websockets | ||
|
|
||
| allow_anonymous true | ||
|
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And it should be stipulated also that it is a very particular setup.
In fact, it only allows a single gateway in a network. It is good for prototyping but not a real use case.