feat: add a docker environment var for continuous watching

This commit is contained in:
Jun Kurihara 2023-07-25 16:52:17 +09:00
commit 5ff285c3ec
No known key found for this signature in database
GPG key ID: D992B3E3DE1DED23
4 changed files with 22 additions and 2 deletions

View file

@ -11,12 +11,16 @@ services:
build:
context: ../
dockerfile: ./docker/Dockerfile
platforms: # Choose your platforms
- "linux/amd64"
# - "linux/arm64"
environment:
- LOG_LEVEL=debug
- LOG_TO_FILE=true
- HOST_USER=jun
- HOST_UID=501
- HOST_GID=501
# - WATCH=true
tty: false
privileged: true
volumes:

View file

@ -7,4 +7,19 @@ if [ -z $LOG_LEVEL ]; then
fi
echo "rpxy: Logging with level ${LOG_LEVEL}"
RUST_LOG=${LOG_LEVEL} /rpxy/bin/rpxy --config ${CONFIG_FILE}
# continuously watch and reload the config file
if [ -z $WATCH ]; then
WATCH=false
else
if [ "$WATCH" = "true" ]; then
WATCH=true
else
WATCH=false
fi
fi
if $WATCH ; then
RUST_LOG=${LOG_LEVEL} /rpxy/bin/rpxy --config ${CONFIG_FILE} -w
else
RUST_LOG=${LOG_LEVEL} /rpxy/bin/rpxy --config ${CONFIG_FILE}
fi