additional files for docker

This commit is contained in:
Jakob Ketterl 2019-12-15 18:28:35 +01:00
parent 88a410a9c0
commit 721ac5e2a3
2 changed files with 12 additions and 8 deletions

View File

@ -13,12 +13,7 @@ ADD . /opt/openwebrx
WORKDIR /opt/openwebrx
RUN mkdir -p /tmp/openwebrx && \
mv "/opt/openwebrx/config_webrx.py" "/opt/openwebrx/config_webrx.py.orig" && \
sed 's/temporary_directory = "\/tmp"/temporary_directory = "\/tmp\/openwebrx"/' < "/opt/openwebrx/config_webrx.py.orig" > "/opt/openwebrx/config_webrx.py" && \
rm "/opt/openwebrx/config_webrx.py.orig"
VOLUME /config
VOLUME /etc/openwebrx
ENTRYPOINT [ "/opt/openwebrx/docker/scripts/run.sh" ]
EXPOSE 8073

View File

@ -1,10 +1,19 @@
#!/bin/bash
set -euo pipefail
mkdir -p /etc/openwebrx/
mkdir -p /tmp/openwebrx/
if [[ ! -f /etc/openwebrx/config_webrx.py ]] ; then
mkdir -p /etc/openwebrx/
cp config_webrx.py /etc/openwebrx/
sed 's/temporary_directory = "\/tmp"/temporary_directory = "\/tmp\/openwebrx"/' < "/opt/openwebrx/config_webrx.py" > "/etc/openwebrx/config_webrx.py"
fi
if [[ ! -f /etc/openwebrx/bands.json ]] ; then
cp bands.json /etc/openwebrx/
fi
if [[ ! -f /etc/openwebrx/bookmarks.json ]] ; then
cp bookmarks.json /etc/openwebrx/
fi
_term() {
echo "Caught signal!"
kill -TERM "$child" 2>/dev/null