Merge pull request #581 from neyder/master

Make kiwix-serve easily deployable on podman Openshift
pull/582/head
Kelson 4 years ago committed by GitHub
commit 4137d9f517
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -5,7 +5,7 @@ FROM kiwix/kiwix-tools:$VERSION
LABEL org.opencontainers.image.source https://github.com/openzim/kiwix-tools LABEL org.opencontainers.image.source https://github.com/openzim/kiwix-tools
# expose kiwix-serve default port and workdir # expose kiwix-serve default port and workdir
EXPOSE 80 EXPOSE 8080
VOLUME /data VOLUME /data
WORKDIR /data WORKDIR /data

@ -9,14 +9,23 @@ With local ZIM file(s)
* Given `wikipedia.zim` and `wiktionary.zim` reside in `/tmp/zim/`, execute the following: * Given `wikipedia.zim` and `wiktionary.zim` reside in `/tmp/zim/`, execute the following:
```bash ```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 With remote ZIM file
-------------------- --------------------
```bash ```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 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
``` ```
ARM ARM

@ -2,7 +2,7 @@ version: '3.3'
services: services:
kiwix-serve: kiwix-serve:
ports: ports:
- 8080:80 - 8080:8080
image: kiwix/kiwix-serve image: kiwix/kiwix-serve
# uncomment next 4 lines to use it with local zim file in /tmp/zim # uncomment next 4 lines to use it with local zim file in /tmp/zim
# volumes: # volumes:

@ -13,7 +13,11 @@ then
fi fi
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 echo $CMD
$CMD $CMD

Loading…
Cancel
Save