diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..de2e38e --- /dev/null +++ b/.dockerignore @@ -0,0 +1,29 @@ +**/__pycache__ +**/.venv +**/.classpath +**/.dockerignore +**/.env +**/.git +**/.gitignore +**/.project +**/.settings +**/.toolstarget +**/.vs +**/.vscode +**/*.*proj.user +**/*.dbmdl +**/*.jfm +**/bin +**/charts +**/docker-compose* +**/compose* +**/Dockerfile* +**/node_modules +**/npm-debug.log +**/obj +**/secrets.dev.yaml +**/values.dev.yaml +README.md +supervisor_RFLinkGateway +RFLinkGateway.service +config.json.sample \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..20d394a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +FROM python:3.8-slim + +# Keeps Python from generating .pyc files in the container +ENV PYTHONDONTWRITEBYTECODE=1 + +# Turns off buffering for easier container logging +ENV PYTHONUNBUFFERED=1 + +# Install pip requirements +COPY requirements.txt . +RUN python -m pip install -r requirements.txt + +WORKDIR /app +COPY . /app + + + +CMD ["python", "RFLinkGateway.py"] diff --git a/readme.md b/readme.md index 58a2456..67343fa 100644 --- a/readme.md +++ b/readme.md @@ -111,9 +111,16 @@ sudo systemctl daemon-reload sudo systemctl enable RFLinkGateway.service ``` +### Start as a docker container +````Shell +cd /opt/scripts/RFLinkGateway +docker build --tag rflink . +docker run --name rflinkgw -v /path/to/configfile:/app/config.json --device=/dev/ttyUSB0:/dev/ttyUSB0:rw rflink:latest +```` + ### Logging Script logs to STDOUT, it can be redirected through supervisord to files or syslog. - +For docker you can use any driver (such a Loki). ## Output data