This is a project to build a docker image, this image provide following functions:
- we can easily migrate traffic from one port to another, just send a reload(http://localhost:8008/sidecar/config/reload?secret=xxx) request.
- We can also help the resource server verify the jwt token issued by the oidc provider through configuration.
- We can also enable apm configuration to help resource server collect metrics to apm.
- May be many application don't have access logs, this image will collect access logs by default and keep them for 7(you can change the crontab) days.
It is base on openresty and dbhys/openresty-stage images.
First:
We add env: $PREFIX, which should be dir your code in and is the same as openresty's
Second:
Copy config/config.yaml from git or from the container use docker command:
docker run -d --rm --name temp dbhys/net-simplesidecar:$verison
docker cp temp:/usr/local/stage/config/config.yaml $yourdir
docker stop temp
Third:
Mount your config dir to the container:
docker run -d --name sidecar -p 80:80 -v yourconfigdir:/usr/local/stage/config/ dbhys/net-simplesidecar:$verison