Skip to content

Commit

Permalink
Merge pull request #20 from Iture:feature-dockerfile
Browse files Browse the repository at this point in the history
Feature-dockerfile
  • Loading branch information
Iture authored Nov 2, 2022
2 parents b0b8f7d + 50bd2c9 commit c10f65f
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 1 deletion.
29 changes: 29 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -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
18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
9 changes: 8 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit c10f65f

Please sign in to comment.