Add launcher script that copies in default config

This commit is contained in:
2023-01-16 16:57:28 -07:00
parent 1caea4c7ab
commit 1a2a872d85
2 changed files with 15 additions and 1 deletions
+3 -1
View File
@@ -25,4 +25,6 @@ RUN apt-get update && apt-get upgrade -y
RUN apt-get install -y \
zlib1g-dev
COPY --from=builder /usr/local/pvpgn /usr/local/pvpgn
ENTRYPOINT ["/usr/local/pvpgn/sbin/bnetd", "-D"]
COPY --from=builder /usr/local/pvpgn/etc /usr/local/pvpgn-backup/etc
COPY launch.sh /
ENTRYPOINT ["/launch.sh"]
Executable
+12
View File
@@ -0,0 +1,12 @@
#!/bin/sh
set -e
# If config directory is mounted to an empty volume,
# copy in the default configuration
if [ ! "$(ls -A /usr/local/pvpgn/etc)" ]; then
echo "Copying in default configuration"
cp -r /usr/local/pvpgn-backup/etc/* /usr/local/pvpgn/etc
fi
/usr/local/pvpgn/sbin/bnetd -D