diff --git a/docker/Dockerfile b/docker/Dockerfile index 6a09e71..2374116 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -52,6 +52,7 @@ VOLUME ["/config", "/plugins"] USER $APRS_USER ADD bin/run.sh /usr/local/bin +ADD bin/listen.sh /usr/local/bin ENTRYPOINT ["/usr/local/bin/run.sh"] HEALTHCHECK --interval=5m --timeout=12s --start-period=30s \ diff --git a/docker/Dockerfile-dev b/docker/Dockerfile-dev index 1303dfe..e2e2eab 100644 --- a/docker/Dockerfile-dev +++ b/docker/Dockerfile-dev @@ -64,6 +64,7 @@ USER $APRS_USER VOLUME ["/config", "/plugins"] ADD bin/run.sh $HOME/ +ADD bin/listen.sh $HOME/ ENTRYPOINT ["/home/aprs/run.sh"] HEALTHCHECK --interval=5m --timeout=12s --start-period=30s \ diff --git a/docker/bin/listen.sh b/docker/bin/listen.sh new file mode 100755 index 0000000..a485576 --- /dev/null +++ b/docker/bin/listen.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash +set -x + +if [ ! -z "${APRSD_PLUGINS}" ]; then + OLDIFS=$IFS + IFS=',' + echo "Installing pypi plugins '$APRSD_PLUGINS'"; + for plugin in ${APRSD_PLUGINS}; do + IFS=$OLDIFS + # call your procedure/other scripts here below + echo "Installing '$plugin'" + pip3 install $plugin + done +fi + +if [ -z "${LOG_LEVEL}" ] || [[ ! "${LOG_LEVEL}" =~ ^(CRITICAL|ERROR|WARNING|INFO)$ ]]; then + LOG_LEVEL="DEBUG" +fi + +echo "Log level is set to ${LOG_LEVEL}"; + +# check to see if there is a config file +APRSD_CONFIG="/config/aprsd.conf" +if [ ! -e "$APRSD_CONFIG" ]; then + echo "'$APRSD_CONFIG' File does not exist. Creating." + aprsd sample-config > $APRSD_CONFIG +fi + +export COLUMNS=200 +python3 -m rich.diagnose +exec aprsd listen -c $APRSD_CONFIG --loglevel ${LOG_LEVEL} ${EXTRA_ARGS} diff --git a/docker/build.sh b/docker/build.sh index 8c9b0d3..d155baa 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -89,7 +89,7 @@ then echo "Build -DEV- with tag=${TAG} BRANCH=${BRANCH} platforms?=${PLATFORMS}" # Use this script to locally build the docker image docker buildx build --push --platform $PLATFORMS \ - -t harbor.hemna.com/hemna6969/aprsd:$TAG \ + -t hemna6969/aprsd:$TAG \ -f Dockerfile-dev --build-arg branch=$BRANCH \ --build-arg BUILDX_QEMU_ENV=true \ --no-cache .