diff --git a/Dockerfile b/Dockerfile new file mode 100755 index 0000000..9a0d22e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM python:3.9-alpine + +COPY entrypoint /entrypoint + +RUN adduser -D -u 54000 radio && \ + apk update && \ + apk add git gcc musl-dev && \ + cd /opt && \ + git clone https://github.com/ShaYmez/hblink3 && \ + cd /opt/hblink3 && \ + pip install --no-cache-dir -r requirements.txt && \ + apk del git gcc musl-dev && \ + chown -R radio: /opt/hblink3 + +USER radio + +ENTRYPOINT [ "/entrypoint" ] diff --git a/README.md b/README.md index 536cc86..bf3e36a 100755 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ This document assumes the reader is familiar with Linux/UNIX, the Python program **Using docker version** +Docker file included for own image build To work with provided docker setup you will need: * A private repository with your configuration files (all .cfg files in repo will be copyed to the application root directory on start up) * A service user able to read your private repository (or be brave and publish your configuration, or be really brave and give your username and password to the docker) @@ -38,18 +39,19 @@ Build your own image from source ```bash -docker build . -t millaguie/hblink:3.0.0 +docker build . -t hblink3/hblink3:latest ``` -Or user a prebuilt one in docker hub: millaguie/hblink:3.0.0 +Or user a prebuilt one in docker hub: shaymez/hblink3:latest +This image is multi-arch Wake up your container ```bash touch /var/log/hblink.log -chown 65000 /var/log/hblink.log - run -v /var/log/hblink.log:/var/log/hblink.log -e GIT_USER=$USER -e GIT_PASSWORD=$PASSWORD -e GIT_REPO=$URL_TO_REPO_WITHOUT_HTTPS:// -p 54000:54000 millaguie/hblink:3.0.0 +chown 54000 -R /var/log/hblink.log + run -v /var/log/hblink/hblink.log:/var/log/hblink/hblink.log -e GIT_USER=$USER -e GIT_PASSWORD=$PASSWORD -e GIT_REPO=$URL_TO_REPO_WITHOUT_HTTPS:// -p 54000:54000 shaymez/hblink3:latest ``` **MORE DOCUMENTATION TO COME** diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100755 index 0000000..df58a61 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,14 @@ +version: '2.4' +services: + hblink3: + container_name: hblink + volumes: + - '/etc/hblink3/hblink.cfg:/opt/hblink3/hblink.cfg' + - '/var/log/hblink/hblink.log:/opt/hblink3/hblink.log' + - '/etc/hblink3/rules.py:/opt/hblink3/rules.py' + ports: + - '62030:62030/udp' + - '62031-62051:62031-62051/udp' + - '4321:4321/tcp' + image: 'shaymez/hblink3:latest' + restart: "unless-stopped" diff --git a/entrypoint b/entrypoint new file mode 100755 index 0000000..fceef72 --- /dev/null +++ b/entrypoint @@ -0,0 +1,4 @@ +#!/bin/sh + +cd /opt/hblink3 +python /opt/hblink3/bridge.py -c hblink.cfg -r rules.py diff --git a/requirements.txt b/requirements.txt index 3d17f35..910b5d3 100755 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ -bitstring>=3.1.5 -bitarray>=0.8.1 -Twisted>=16.3.0 -dmr_utils3>=0.1.19 -configparser>=3.0.0 +bitstring>=3.1.9 +bitarray>=2.3.5 +Twisted>=21.7.0 +dmr_utils3>=0.1.29 +configparser>=5.2.0