Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tebbers patch 1 1 #2

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# kong31-wallarm

Docker image with Kong 3.1.1-ubuntu and Wallarm 4.6 - https://hub.docker.com/r/dmikhin/kong31-wallarm
Docker image with Kong 3.1.1-ubuntu and Wallarm 4.6 - https://hub.docker.com/r/ebberst/kong31-wallarm

Example of execution:
```
Expand All @@ -14,11 +14,12 @@ docker run -it --rm --name kong \
-e 'KONG_DECLARATIVE_CONFIG_STRING={"_format_version":"1.1", "services":[{"host":"mockbin.com","port":443,"protocol":"https", "routes":[{"paths":["/"]}]}]}' \
-e 'WALLARM_API_HOST=api.wallarm.com' \
-e 'WALLARM_API_TOKEN=<put your token here>' \
-e 'WALLARM_LABELS=group=<put your group here>' \
-e 'TARANTOOL_MEMORY_GB=1' \
-e 'WALLARM_MODE=block' \
-p 8000:8000 \
-p 8443:8443 \
-p 8001:8001 \
-p 8444:8444 \
dmikhin/kong31-wallarm:latest
```
ebberst/kong31-wallarm:latest
```
4 changes: 2 additions & 2 deletions build_push.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
set -ex

docker build --pull \
--tag dmikhin/kong31-wallarm:latest .
docker push dmikhin/kong31-wallarm:latest
--tag ebberst/kong31-wallarm:latest .
docker push ebberst/kong31-wallarm:latest
6 changes: 6 additions & 0 deletions scripts/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ if [[ "$1" == "kong" ]]; then
if [ -n "$WALLARM_MODE" ]; then
sed -i -e "s|wallarm_mode monitoring|wallarm_mode $WALLARM_MODE|g" /usr/local/share/lua/5.1/kong/templates/nginx_kong.lua
fi
if [ -n "$WALLARM_APPLICATION" ]; then
sed -i -e "s|wallarm_application -1 |wallarm_application $WALLARM_APPLICATION|g" /usr/local/share/lua/5.1/kong/templates/nginx_kong.lua
fi
kong prepare -p "$PREFIX" "$@"

ln -sf /dev/stdout $PREFIX/logs/access.log
Expand All @@ -54,6 +57,9 @@ if [[ "$1" == "kong" ]]; then
if [ -n "$WALLARM_API_HOST" ]; then
args="$args -H $WALLARM_API_HOST"
fi
if [ -n "$WALLARM_LABELS" ]; then
args="$args --labels $WALLARM_LABELS"
fi
if [ -n "$TARANTOOL_MEMORY_GB" ]; then
sed -i -e "s|SLAB_ALLOC_ARENA=0.2|SLAB_ALLOC_ARENA=$TARANTOOL_MEMORY_GB|g" /opt/wallarm/env.list
fi
Expand Down