Merge pull request #62 from junkurihara/feat-docker-watch
feat: add a docker environment var for continuous watching
This commit is contained in:
commit
67f0071045
4 changed files with 22 additions and 2 deletions
|
|
@ -238,6 +238,7 @@ You can also use [docker image](https://hub.docker.com/r/jqtype/rpxy) instead of
|
||||||
- `HOST_GID` (default: `900`): `GID` of `HOST_USER`
|
- `HOST_GID` (default: `900`): `GID` of `HOST_USER`
|
||||||
- `LOG_LEVEL=debug|info|warn|error`: Log level
|
- `LOG_LEVEL=debug|info|warn|error`: Log level
|
||||||
- `LOG_TO_FILE=true|false`: Enable logging to the log file `/rpxy/log/rpxy.log` using `logrotate`. You should mount `/rpxy/log` via docker volume option if enabled. The log dir and file will be owned by the `HOST_USER` with `HOST_UID:HOST_GID` on the host machine. Hence, `HOST_USER`, `HOST_UID` and `HOST_GID` should be the same as ones of the user who executes the `rpxy` docker container on the host.
|
- `LOG_TO_FILE=true|false`: Enable logging to the log file `/rpxy/log/rpxy.log` using `logrotate`. You should mount `/rpxy/log` via docker volume option if enabled. The log dir and file will be owned by the `HOST_USER` with `HOST_UID:HOST_GID` on the host machine. Hence, `HOST_USER`, `HOST_UID` and `HOST_GID` should be the same as ones of the user who executes the `rpxy` docker container on the host.
|
||||||
|
- `WATCH=true|false` (default: `false`): Activate continuous watching of the config file if true.
|
||||||
|
|
||||||
Other than them, all you need is to mount your `config.toml` as `/etc/rpxy.toml` and certificates/private keys as you like through the docker volume option. See [`docker/docker-compose.yml`](./docker/docker-compose.yml) for the detailed configuration. Note that the file path of keys and certificates must be ones in your docker container.
|
Other than them, all you need is to mount your `config.toml` as `/etc/rpxy.toml` and certificates/private keys as you like through the docker volume option. See [`docker/docker-compose.yml`](./docker/docker-compose.yml) for the detailed configuration. Note that the file path of keys and certificates must be ones in your docker container.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,12 +11,16 @@ services:
|
||||||
build:
|
build:
|
||||||
context: ../
|
context: ../
|
||||||
dockerfile: ./docker/Dockerfile
|
dockerfile: ./docker/Dockerfile
|
||||||
|
platforms: # Choose your platforms
|
||||||
|
- "linux/amd64"
|
||||||
|
# - "linux/arm64"
|
||||||
environment:
|
environment:
|
||||||
- LOG_LEVEL=debug
|
- LOG_LEVEL=debug
|
||||||
- LOG_TO_FILE=true
|
- LOG_TO_FILE=true
|
||||||
- HOST_USER=jun
|
- HOST_USER=jun
|
||||||
- HOST_UID=501
|
- HOST_UID=501
|
||||||
- HOST_GID=501
|
- HOST_GID=501
|
||||||
|
# - WATCH=true
|
||||||
tty: false
|
tty: false
|
||||||
privileged: true
|
privileged: true
|
||||||
volumes:
|
volumes:
|
||||||
|
|
|
||||||
|
|
@ -7,4 +7,19 @@ if [ -z $LOG_LEVEL ]; then
|
||||||
fi
|
fi
|
||||||
echo "rpxy: Logging with level ${LOG_LEVEL}"
|
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
|
||||||
|
else
|
||||||
RUST_LOG=${LOG_LEVEL} /rpxy/bin/rpxy --config ${CONFIG_FILE}
|
RUST_LOG=${LOG_LEVEL} /rpxy/bin/rpxy --config ${CONFIG_FILE}
|
||||||
|
fi
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ rpxy-lib = { path = "../rpxy-lib/", features = ["http3", "sticky-cookie"] }
|
||||||
|
|
||||||
anyhow = "1.0.72"
|
anyhow = "1.0.72"
|
||||||
rustc-hash = "1.1.0"
|
rustc-hash = "1.1.0"
|
||||||
serde = { version = "1.0.174", default-features = false, features = ["derive"] }
|
serde = { version = "1.0.175", default-features = false, features = ["derive"] }
|
||||||
derive_builder = "0.12.0"
|
derive_builder = "0.12.0"
|
||||||
tokio = { version = "1.29.1", default-features = false, features = [
|
tokio = { version = "1.29.1", default-features = false, features = [
|
||||||
"net",
|
"net",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue