Skip to content
Snippets Groups Projects
Commit 194bc233 authored by Ellis Percival's avatar Ellis Percival
Browse files

Add Dockerfile and update readme. #55

parent 180fb7e2
No related branches found
No related tags found
No related merge requests found
.tox
.eggs
.ignore
.pytest_cache
.vscode
dist
\ No newline at end of file
from python:3.6-stretch
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
RUN pip install --no-cache-dir pipenv
RUN useradd -m -s /bin/bash mqttgpio
USER mqttgpio
WORKDIR /home/mqttgpio
COPY Pipfile* ./
RUN pipenv install --three --deploy
COPY pi_mqtt_gpio pi_mqtt_gpio
CMD [ "pipenv", "run", "python", "-m", "pi_mqtt_gpio.server", "/config.yml" ]
...@@ -254,3 +254,32 @@ sudo supervisorctl status ...@@ -254,3 +254,32 @@ sudo supervisorctl status
``` ```
Check the [supervisor docs](http://supervisord.org/running.html#supervisorctl-command-line-options) for more `supervisorctl` commands. Check the [supervisor docs](http://supervisord.org/running.html#supervisorctl-command-line-options) for more `supervisorctl` commands.
Docker
------
You may also run this software using Docker. You must create your config file as above, then run the docker image:
```
docker run -ti --rm -v /path/to/your/config.yml:/config.yml flyte/mqtt-gpio
```
Or to run in the background:
```
docker run -d --name mqtt-gpio -v /path/to/your/config.yml:/config.yml flyte/mqtt-gpio
```
You'll most likely want to use some hardware devices in your config, since that's what this project is all about. For example, if you wish to use the i2c bus, pass it through with a `--device` parameter:
```
docker run -ti --rm -v /path/to/your/config.yml:/config.yml --device /dev/i2c-0 flyte/mqtt-gpio
```
If you aren't able to find the exact device path to use, then you can also run the docker container in `--privileged` mode which will pass all of the devices through from the host:
```
docker run -ti --rm -v /path/to/your/config.yml:/config.yml --privileged flyte/mqtt-gpio
```
_Please raise an issue on Github if any of this information is incorrect._
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment