mirror of
https://github.com/kiwix/kiwix-tools.git
synced 2025-08-03 19:36:00 -04:00
Add ability to download a file at container start
This commit is contained in:
parent
e8b33a7136
commit
7ec2308053
@ -12,4 +12,7 @@ RUN curl -kL https://download.kiwix.org/release/kiwix-tools/kiwix-tools_linux-x8
|
|||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
VOLUME /data
|
VOLUME /data
|
||||||
WORKDIR /data
|
WORKDIR /data
|
||||||
ENTRYPOINT ["/usr/local/bin/kiwix-serve", "--port", "80"]
|
|
||||||
|
COPY ./start.sh /usr/local/bin/
|
||||||
|
|
||||||
|
ENTRYPOINT ["/usr/local/bin/start.sh"]
|
||||||
|
@ -1,13 +1,26 @@
|
|||||||
kiwix-serve Docker image
|
Kiwix serve Docker image
|
||||||
========================
|
========================
|
||||||
|
|
||||||
|
Use with local ZIM file
|
||||||
|
-----------------------
|
||||||
|
|
||||||
* Download a ZIM file from <https://wiki.kiwix.org/wiki/Content>
|
* Download a ZIM file from <https://wiki.kiwix.org/wiki/Content>
|
||||||
|
|
||||||
* Given `wikipedia.zim` resides in `/tmp/zim/`, execute the following:
|
* Given `wikipedia.zim` resides in `/tmp/zim/`, execute the following:
|
||||||
|
|
||||||
```
|
```bash
|
||||||
docker run -v /tmp/zim:/data -p 8080:80 kiwix/kiwix-serve wikipedia.zim
|
docker run -v /tmp/zim:/data -p 8080:80 kiwix/kiwix-serve wikipedia.zim
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Use with remote ZIM file
|
||||||
|
------------------------
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker run -e "DOWNLOAD=https://download.kiwix.org/zim/wikipedia/wikipedia_bm_all.zim" -p 8080:80 kiwix/kiwix-serve
|
||||||
|
```
|
||||||
|
|
||||||
|
Screenshots
|
||||||
|
-----------
|
||||||
|
|
||||||

|

|
||||||

|

|
||||||
|
16
docker/server/start.sh
Executable file
16
docker/server/start.sh
Executable file
@ -0,0 +1,16 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Download if necessary a file
|
||||||
|
if [ ! -z "$DOWNLOAD" ]
|
||||||
|
then
|
||||||
|
ZIM=`basename $DOWNLOAD`
|
||||||
|
wget $DOWNLOAD -O "$ZIM"
|
||||||
|
|
||||||
|
# Set arguments
|
||||||
|
if [ "$#" -eq "0" ]
|
||||||
|
then
|
||||||
|
set -- "$@" $ZIM
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
/usr/local/bin/kiwix-serve --port=80 $@
|
Loading…
x
Reference in New Issue
Block a user