Added a background process for updating the DB
This commit is contained in:
@@ -8,7 +8,7 @@ WORKDIR /netflowParser
|
|||||||
|
|
||||||
# Copy over IP2Loc, INFLUXDB, proto and wahtDomain
|
# Copy over IP2Loc, INFLUXDB, proto and wahtDomain
|
||||||
|
|
||||||
COPY ../Code/* /netflowParser/
|
COPY ./Code/* /netflowParser/
|
||||||
COPY ./entrypoint.sh /entrypoint.sh
|
COPY ./entrypoint.sh /entrypoint.sh
|
||||||
COPY ./updateIP2Lbin.sh /netflowParser/
|
COPY ./updateIP2Lbin.sh /netflowParser/
|
||||||
|
|
||||||
@@ -26,5 +26,13 @@ fi
|
|||||||
# Fix permissions (only do this on /app/API)
|
# Fix permissions (only do this on /app/API)
|
||||||
chown -R "$PUID:$PGID" "$CHOWNPATH"
|
chown -R "$PUID:$PGID" "$CHOWNPATH"
|
||||||
|
|
||||||
|
# Create an updater process
|
||||||
|
(
|
||||||
|
while true; do
|
||||||
|
sleep 12h
|
||||||
|
su-exec "$PUID:$PGID" "/bin/sh" "$CHOWNPATH"/updateIP2Lbin.sh || true
|
||||||
|
done
|
||||||
|
) &
|
||||||
|
|
||||||
# Drop privileges & run command
|
# Drop privileges & run command
|
||||||
exec su-exec "$PUID:$PGID" "$@"
|
exec su-exec "$PUID:$PGID" "$@"
|
||||||
Reference in New Issue
Block a user