Update docker compose installer (includes dash etc)

This commit is contained in:
Simon 2021-07-26 00:35:12 +01:00
parent 422bfd5f53
commit e5f7cf06c7
3 changed files with 94 additions and 6 deletions

View File

@ -2,6 +2,8 @@ version: '2.1'
services:
freedmr:
container_name: freedmr
depends_on:
- ipv6nat
volumes:
- '/etc/freedmr/freedmr.cfg:/opt/freedmr/freedmr.cfg'
- '/var/log/freedmr/freedmr.log:/opt/freedmr/freedmr.log'
@ -37,6 +39,8 @@ services:
freedmrmon:
container_name: freedmrmon
depends_on:
- freedmr
volumes:
#This should be kept to a manageable size from
#cron or logrotate outisde of the container.
@ -60,6 +64,8 @@ services:
freedmrmonpache:
container_name: freedmrmonapache
depends_on:
- freedmrmon
#Use to override html files
#And images
#volumes:

View File

@ -1,4 +1,4 @@
version: '3.3'
version: '2.1'
services:
freedmr:
container_name: freedmr
@ -6,9 +6,66 @@ services:
- '/etc/freedmr/freedmr.cfg:/opt/freedmr/freedmr.cfg'
- '/var/log/freedmr/freedmr.log:/opt/freedmr/freedmr.log'
- '/etc/freedmr/rules.py:/opt/freedmr/rules.py'
#Write JSON files outside of container
- '/etc/freedmr/json/talkgroup_ids.json:/opt/freedmr/talkgroup_ids.json'
- '/etc/freedmr/json/subscriber_ids.json:/opt/freedmr/subscriber_ids.json'
- '/etc/freedmr/json/peer_ids.json:/opt/freedmr/peer_ids.json'
ports:
- '62031:62031/udp'
- '62045-62049:62045-62049/udp'
- '4321:4321/tcp'
- '62044-62049:62044-62049/udp'
image: 'hacknix/freedmr:latest'
restart: "unless-stopped"
networks:
app_net:
ipv4_address: 172.16.238.10
read_only: "true"
freedmrmon:
container_name: freedmrmon
depends_on:
- freedmr
volumes:
#This should be kept to a manageable size from
#cron or logrotate outisde of the container.
- '/var/log/freeDMRmonitor/lastheard.log:/opt/FreeDMRmonitor/log/lastheard.log'
- '/var/log/freeDMRmonitor/hbmon.log:/opt/FreeDMRmonitor/log/hbmon.log'
#Write JSON files outside of container
- '/etc/freedmr/json/talkgroup_ids.json:/opt/FreeDMRmonitor/talkgroup_ids.json'
- '/etc/freedmr/json/subscriber_ids.json:/opt/FreeDMRmonitor/subscriber_ids.json'
- '/etc/freedmr/json/peer_ids.json:/opt/FreeDMRmonitor/peer_ids.json'
#Override config file
# - '/etc/freedmr/config.py:/opt/FreeDMRmonitor/config.py'
ports:
- '9000:9000/tcp'
image: 'hacknix/freedmrmonitor:latest'
restart: "unless-stopped"
networks:
app_net:
ipv4_address: 172.16.238.20
freedmrmonpache:
container_name: freedmrmonapache
depends_on:
- freedmrmon
#Use to override html files
#And images
#volumes:
# - '/var/www/html/:/var/www/html/'
# - '/var/www/html/images/:/var/www/html/images/'
ports:
- '80:80/tcp'
image: hacknix/freedmrmonitor-apache:latest
restart: "unless-stopped"
networks:
app_net:
ipv4_address: 172.16.238.30
networks:
app_net:
driver: bridge
ipam:
driver: default
config:
- subnet: 172.16.238.0/24
gateway: 172.16.238.1

View File

@ -17,6 +17,16 @@ echo Make config directory...
mkdir /etc/freedmr &&
chmod 755 /etc/freedmr &&
echo make json directory...
mkdir -p /etc/freedmr/json &&
echo get json files...
cd /etc/freedmr/json &&
curl http://downloads.freedmr.uk/downloads/local_subscriber_ids.json -o subscriber_ids.json &&
curl http://downloads.freedmr.uk/downloads/talkgroup_ids.json -o talkgroup_ids.json &&
curl https://www.radioid.net/static/rptrs.json -o peer_ids.json &&
chmod -R 777 /etc/freedmr/json &&
echo Install /etc/freedmr/freedmr.cfg ...
cat << EOF > /etc/freedmr/freedmr.cfg
[GLOBAL]
@ -30,7 +40,7 @@ TGID_TS1_ACL: PERMIT:ALL
TGID_TS2_ACL: PERMIT:ALL
GEN_STAT_BRIDGES: True
ALLOW_NULL_PASSPHRASE: True
ANNOUNCEMENT_LANGUAGES: en_GB,en_GB_2,en_US,es_ES,es_ES_2,fr_FR,de_DE,dk_DK,it_IT,no_NO,pl_PL,se_SE
ANNOUNCEMENT_LANGUAGES: en_GB,en_GB_2,en_US,es_ES,es_ES_2,fr_FR,de_DE,dk_DK,it_IT,no_NO,pl_PL,se_SE,CW,cy_GB
SERVER_ID: 0
[REPORTS]
@ -52,7 +62,7 @@ PEER_FILE: peer_ids.json
SUBSCRIBER_FILE: subscriber_ids.json
TGID_FILE: talkgroup_ids.json
PEER_URL: https://www.radioid.net/static/rptrs.json
SUBSCRIBER_URL: https://www.radioid.net/static/users.json
SUBSCRIBER_URL: http://downloads.freedmr.uk/downloads/local_subscriber_ids.json
TGID_URL: TGID_URL: http://downloads.freedmr.uk/downloads/talkgroup_ids.json
STALE_DAYS: 7
@ -149,10 +159,25 @@ echo Setup logging...
mkdir -p /var/log/freedmr &&
touch /var/log/freedmr/freedmr.log &&
chown -R 54000 /var/log/freedmr &&
mkdir -p /var/log/FreeDMRmonitor &&
touch /var/log/FreeDMRmonitor/lastheard.log &&
touch /var/log/FreeDMRmonitor/hbmon.log &&
chown -R 54001 /var/log/FreeDMRmonitor &&
echo Get docker-compose.yml...
cd /etc/freedmr &&
curl https://raw.githubusercontent.com/hacknix/FreeDMR/master/docker-configs/docker-compose.yml -o docker-compose.yml
curl https://raw.githubusercontent.com/hacknix/FreeDMR/master/docker-configs/docker-compose.yml -o docker-compose.yml &&
echo Install crontab...
cat << EOF > /etc/cron.daily/lastheard
#!/bin/bash
mv /var/log/FreeDMRmonitor/lastheard.log /var/log/FreeDMRmonitor/lastheard.log.save
/usr/bin/tail -150 /var/log/FreeDMRmonitor/lastheard.log.save > /var/log/FreeDMRmonitor/lastheard.log
mv /var/log/FreeDMRmonitor/lastheard.log /var/log/FreeDMRmonitor/lastheard.log.save
/usr/bin/tail -150 /var/log/FreeDMRmonitor/lastheard.log.save > /var/log/FreeDMRmonitor/lastheard.log
EOF
chmod 755 /etc/cron.daily/lastheard
echo Run FreeDMR container...
docker-compose up -d