Skip to content

Commit cad8cc8

Browse files
CubieMediananomad
authored andcommitted
Added docker compose commands to README.md
Fixed wrong MQTT port in ".env" Fixed wrong MQTT_PASSWORD Variable in docker-compose.yml
1 parent 7b12bd5 commit cad8cc8

File tree

3 files changed

+17
-2
lines changed

3 files changed

+17
-2
lines changed

.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
MQTT_BROKER_URI=tcp://localhost:1833
1+
MQTT_BROKER_URI=tcp://localhost:1883
22
MQTT_USERNAME=mqtt_user
33
MQTT_PASSWORD=secret
44
SAIC_USERNAME=[email protected]

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,22 @@ from [docker hub](https://hub.docker.com/r/saicismartapi/saic-python-mqtt-gatewa
145145
$ docker build -t saic-mqtt-gateway .
146146
```
147147

148+
#### Use docker compose
149+
148150
There is a [docker compose file](docker-compose.yml) that shows how to set up the service.
149151

152+
First setup the hidden ".env" file in the root directory of the project with your specific data
153+
154+
Test your setup with
155+
```
156+
$ docker compose up
157+
```
158+
159+
Let it run in background (dedicated)
160+
```
161+
$ docker compose up -d
162+
```
163+
150164
## Commands over MQTT
151165

152166
The MQTT Gateway subscribes to MQTT topics where it is listening for commands. Every topic in the table below starts

docker-compose.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ services:
33
image: "saicismartapi/saic-python-mqtt-gateway:latest"
44
build:
55
context: .
6+
restart: always
67
container_name: "saic-mqtt-gateway"
78
environment:
89
- MQTT_URI=${MQTT_BROKER_URI}
910
- MQTT_USER=${MQTT_USERNAME}
10-
- MQTT_PASSWORD=${MQTT_PWD}
11+
- MQTT_PASSWORD=${MQTT_PASSWORD}
1112
- SAIC_USER=${SAIC_USERNAME}
1213
- SAIC_PASSWORD=${SAIC_PWD}
1314
volumes:

0 commit comments

Comments
 (0)