From 847d1e9e7630261e99a72b4d98ac6f3a920ed47a Mon Sep 17 00:00:00 2001 From: Neyder Achahuanco Apaza Date: Fri, 21 Oct 2022 15:11:14 -0500 Subject: [PATCH 1/3] Modify default port so it cna be used on secured kubernetes --- docker/server/Dockerfile | 2 +- docker/server/start.sh | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docker/server/Dockerfile b/docker/server/Dockerfile index b388742..d1a8d7c 100644 --- a/docker/server/Dockerfile +++ b/docker/server/Dockerfile @@ -5,7 +5,7 @@ FROM kiwix/kiwix-tools:$VERSION LABEL org.opencontainers.image.source https://github.com/openzim/kiwix-tools # expose kiwix-serve default port and workdir -EXPOSE 80 +EXPOSE 8080 VOLUME /data WORKDIR /data diff --git a/docker/server/start.sh b/docker/server/start.sh index 2b8e7b4..75ba3eb 100755 --- a/docker/server/start.sh +++ b/docker/server/start.sh @@ -13,7 +13,11 @@ then fi fi -CMD="/usr/local/bin/kiwix-serve --port=80 $@" +if [ -z "$PORT" ] +then + PORT=8080 +fi +CMD="/usr/local/bin/kiwix-serve --port=$PORT $@" echo $CMD $CMD From 70c390c7d12ffc8e304f0c6dd0b534e26c4359f4 Mon Sep 17 00:00:00 2001 From: Neyder Achahuanco Apaza Date: Sun, 23 Oct 2022 09:54:46 -0500 Subject: [PATCH 2/3] Modify documentation to reflect PORT variable and default to 8080 --- docker/server/README.md | 13 +++++++++++-- docker/server/docker-compose.yml.example | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/docker/server/README.md b/docker/server/README.md index 3ca259b..f472917 100644 --- a/docker/server/README.md +++ b/docker/server/README.md @@ -9,14 +9,23 @@ With local ZIM file(s) * Given `wikipedia.zim` and `wiktionary.zim` reside in `/tmp/zim/`, execute the following: ```bash -docker run -v /tmp/zim:/data -p 8080:80 kiwix/kiwix-serve wikipedia.zim wiktionary.zim +docker run -v /tmp/zim:/data -p 8080:8080 kiwix/kiwix-serve wikipedia.zim wiktionary.zim ``` With remote ZIM file -------------------- ```bash -docker run -e "DOWNLOAD=https://download.kiwix.org/zim/wikipedia_bm_all.zim" -p 8080:80 kiwix/kiwix-serve +docker run -e "DOWNLOAD=https://download.kiwix.org/zim/wikipedia_bm_all.zim" -p 8080:8080 kiwix/kiwix-serve +``` + +Change default port +------------------- + +You can change port to expose with environment PORT, useful if running on Podman, K8s or OpenShift + +```bash +podman run -e "DOWNLOAD=https://download.kiwix.org/zim/wikipedia_bm_all.zim" -e PORT=8888 -p 8080:8888 kiwix/kiwix-serve ``` ARM diff --git a/docker/server/docker-compose.yml.example b/docker/server/docker-compose.yml.example index 6b3a80d..a3d166b 100644 --- a/docker/server/docker-compose.yml.example +++ b/docker/server/docker-compose.yml.example @@ -2,7 +2,7 @@ version: '3.3' services: kiwix-serve: ports: - - 8080:80 + - 8080:8080 image: kiwix/kiwix-serve # uncomment next 4 lines to use it with local zim file in /tmp/zim # volumes: From 1a25b4251787cb7e35a4d17f3ca0a1c846a836d7 Mon Sep 17 00:00:00 2001 From: Neyder Achahuanco Apaza Date: Mon, 24 Oct 2022 17:00:32 -0500 Subject: [PATCH 3/3] Fixed README --- docker/server/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/server/README.md b/docker/server/README.md index f472917..4904e40 100644 --- a/docker/server/README.md +++ b/docker/server/README.md @@ -22,7 +22,7 @@ docker run -e "DOWNLOAD=https://download.kiwix.org/zim/wikipedia_bm_all.zim" -p Change default port ------------------- -You can change port to expose with environment PORT, useful if running on Podman, K8s or OpenShift +You can change port to expose with environment variable PORT, useful if running on Podman, K8s or OpenShift ```bash podman run -e "DOWNLOAD=https://download.kiwix.org/zim/wikipedia_bm_all.zim" -e PORT=8888 -p 8080:8888 kiwix/kiwix-serve