Merge pull request #18 from ShaYmez/master

Update requiremets - prepped for docker multi-arch
This commit is contained in:
Randy Hall 2022-01-28 15:41:13 -08:00 committed by GitHub
commit f68fbdd26a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 46 additions and 9 deletions

17
Dockerfile Executable file
View File

@ -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" ]

View File

@ -28,6 +28,7 @@ This document assumes the reader is familiar with Linux/UNIX, the Python program
**Using docker version** **Using docker version**
Docker file included for own image build
To work with provided docker setup you will need: 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 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) * 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 ```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 Wake up your container
```bash ```bash
touch /var/log/hblink.log touch /var/log/hblink.log
chown 65000 /var/log/hblink.log chown 54000 -R /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 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** **MORE DOCUMENTATION TO COME**

14
docker-compose.yml Executable file
View File

@ -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"

4
entrypoint Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
cd /opt/hblink3
python /opt/hblink3/bridge.py -c hblink.cfg -r rules.py

View File

@ -1,5 +1,5 @@
bitstring>=3.1.5 bitstring>=3.1.9
bitarray>=0.8.1 bitarray>=2.3.5
Twisted>=16.3.0 Twisted>=21.7.0
dmr_utils3>=0.1.19 dmr_utils3>=0.1.29
configparser>=3.0.0 configparser>=5.2.0