diff --git a/.env b/.env index 14f0c58..2858c5c 100644 --- a/.env +++ b/.env @@ -1,4 +1,4 @@ -MQTT_BROKER_URI=tcp://localhost:1833 +MQTT_BROKER_URI=tcp://localhost:1883 MQTT_USERNAME=mqtt_user MQTT_PASSWORD=secret SAIC_USERNAME=me@home.da diff --git a/README.md b/README.md index 5d52f1d..876ed32 100644 --- a/README.md +++ b/README.md @@ -145,8 +145,22 @@ from [docker hub](https://hub.docker.com/r/saicismartapi/saic-python-mqtt-gatewa $ docker build -t saic-mqtt-gateway . ``` +#### Use docker compose + There is a [docker compose file](docker-compose.yml) that shows how to set up the service. +First setup the hidden ".env" file in the root directory of the project with your specific data + +Test your setup with +``` +$ docker compose up +``` + +Let it run in background (dedicated) +``` +$ docker compose up -d +``` + ## Commands over MQTT The MQTT Gateway subscribes to MQTT topics where it is listening for commands. Every topic in the table below starts diff --git a/docker-compose.yml b/docker-compose.yml index 4171c0f..8d21703 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,11 +3,12 @@ services: image: "saicismartapi/saic-python-mqtt-gateway:latest" build: context: . + restart: always container_name: "saic-mqtt-gateway" environment: - MQTT_URI=${MQTT_BROKER_URI} - MQTT_USER=${MQTT_USERNAME} - - MQTT_PASSWORD=${MQTT_PWD} + - MQTT_PASSWORD=${MQTT_PASSWORD} - SAIC_USER=${SAIC_USERNAME} - SAIC_PASSWORD=${SAIC_PWD} volumes: