Skip to content

Commit b8973e0

Browse files
chore: add documentation to run docker container correctly
1 parent 3d3d430 commit b8973e0

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

README.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,23 @@
1-
# operating-block-gateway
1+
# Operating Block Gateway
22

33
Create an environment file with:
44
1. `AZURE_DT_CLIENT_ID`: the id of the app
55
2. `AZURE_DT_CLIENT_SECRET`: the secret of the app
6+
3. `AZURE_DT_TENANT_ID`: the id of the tenant
7+
8+
Due to a bug in the node-red-node-serialport library, it is not possible to execute the docker container directly as described in the following [issue](https://github.com/node-red/node-red/issues/3461)
69

710
To run the microservice use the following docker command:
11+
12+
``` bash
13+
$ docker rm operating-block-gateway
14+
$ docker run -d --rm --device /dev/ttyUSB0:/dev/ttyUSB0 -v ./data:/data -p 1880:1880 -e NODE_RED_ENABLE_SAFE_MODE=true ghcr.io/smartoperatingblock/operating-block-gateway:<latestVersion>
15+
$ docker exec -it operating-block-gateway /bin/sh -c "cd /data; npm rebuild --build-from-source; exit"
16+
$ docker stop operating-block-gateway
17+
$ docker run -p 1880:1880 -v ./data:/data --device /dev/ttyUSB0:/dev/ttyUSB0 --group-add dialout --env-file .env --name operating-block-gateway ghcr.io/smartoperatingblock/operating-block-gateway:<latestVersion>
818
```
9-
sudo docker run -p 1880:1880 --group-add dialout ghcr.io/smartoperatingblock/operating-block-gateway:<latestVersion>
10-
```
19+
20+
In order to simplify we provide a bash script that executes all the instructions above automatically.
21+
22+
23+

0 commit comments

Comments
 (0)