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

Make kiwix-serve easily deployable on podman Openshift #581

Merged
merged 3 commits into from
Oct 26, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion docker/server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
13 changes: 11 additions & 2 deletions docker/server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
kelson42 marked this conversation as resolved.
Show resolved Hide resolved

```bash
podman run -e "DOWNLOAD=https://download.kiwix.org/zim/wikipedia_bm_all.zim" -e PORT=8888 -p 8080:8888 kiwix/kiwix-serve
```

ARM
Expand Down
2 changes: 1 addition & 1 deletion docker/server/docker-compose.yml.example
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 5 additions & 1 deletion docker/server/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down