update docker for log-dir option

This commit is contained in:
Jun Kurihara 2025-04-30 18:25:14 +09:00
commit f73b2ce919
No known key found for this signature in database
GPG key ID: 48ADFD173ED22B03
8 changed files with 47 additions and 37 deletions

View file

@ -1,5 +1,7 @@
#!/usr/bin/env sh
CONFIG_FILE=/etc/rpxy.toml
LOG_DIR=/rpxy/log
LOGGING=${LOG_TO_FILE:-false}
# debug level logging
if [ -z $LOG_LEVEL ]; then
@ -7,19 +9,11 @@ if [ -z $LOG_LEVEL ]; then
fi
echo "rpxy: Logging with level ${LOG_LEVEL}"
# 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
if "${LOGGING}"; then
echo "rpxy: Start with writing log files"
RUST_LOG=${LOG_LEVEL} /rpxy/bin/rpxy --config ${CONFIG_FILE} --log-dir ${LOG_DIR}
else
echo "rpxy: Start without writing log files"
RUST_LOG=${LOG_LEVEL} /rpxy/bin/rpxy --config ${CONFIG_FILE}
fi