-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
209 additions
and
449 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,3 +19,8 @@ node_modules | |
/kiwix-tools | ||
|
||
bin/zimdump | ||
|
||
*.tfstate | ||
*.tfstate.* | ||
*.terraform | ||
*.terraform.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,34 @@ | ||
# This Dockerfile creates a self-contained image in which mirrorzim.sh can be executed | ||
# This Dockerfile creates a self-contained image in which mirrorzim.sh can be executed. | ||
# It also runs ipfs daemon. | ||
# | ||
# You can build the image as follows (remember to use this repo as context for the build): | ||
# docker build . -f Dockerfile -t distributed-wikipedia-mirror | ||
# docker build . --platform=linux/amd64 -f Dockerfile -t distributed-wikipedia-mirror | ||
# | ||
# You can then run the container anywhere as follows | ||
# docker run --rm -v $(pwd)/snapshots:/github/workspace/snapshots -v $(pwd)/tmp:/github/workspace/tmp distributed-wikipedia-mirror <mirrorzim.sh arguments> | ||
# NOTE(s): | ||
# - volume attached at /github/workspace/snapshots will contain downloaded zim files after the run | ||
# - volume attached at /github/workspace/tmp will contain created website directories after the run | ||
# You can then run the container anywhere as follows: | ||
# docker run --ulimit nofile=65536:65536 -p 4001:4001/tcp -p 4001:4001/udp distributed-wikipedia-mirror <mirrorzim_arguments> | ||
|
||
FROM openzim/zim-tools:3.1.0 AS openzim | ||
FROM stedolan/jq:latest AS jq | ||
FROM openzim/zim-tools:3.1.0 AS zimdump | ||
FROM ipfs/go-ipfs:v0.12.0 AS ipfs | ||
FROM node:16 | ||
|
||
FROM node:16.14.0-buster-slim | ||
RUN apt-get update && apt-get install --no-install-recommends --assume-yes rsync moreutils | ||
|
||
RUN apt update && apt upgrade && apt install -y curl wget rsync | ||
COPY --from=jq /usr/local/bin/jq /usr/local/bin/ | ||
COPY --from=zimdump /usr/local/bin/zimdump /usr/local/bin/ | ||
COPY --from=ipfs /usr/local/bin/ipfs /usr/local/bin/ | ||
|
||
COPY --from=openzim /usr/local/bin/zimdump /usr/local/bin | ||
COPY assets /root/assets | ||
COPY bin /root/bin | ||
COPY src /root/src | ||
COPY tools /root/tools | ||
COPY mirrorzim.sh package.json tsconfig.json /root/ | ||
|
||
COPY tools/docker_entrypoint.sh /usr/local/bin | ||
RUN mkdir /root/snapshots /root/tmp | ||
RUN cd /root && yarn | ||
|
||
RUN mkdir -p /github/distributed-wikipedia-mirror | ||
RUN mkdir -p /github/distributed-wikipedia-mirror/snapshots | ||
RUN mkdir -p /github/distributed-wikipedia-mirror/tmp | ||
RUN mkdir -p /github/workspace | ||
EXPOSE 4001/tcp | ||
EXPOSE 4001/udp | ||
|
||
COPY . /github/distributed-wikipedia-mirror | ||
|
||
RUN cd /github/distributed-wikipedia-mirror && yarn | ||
|
||
VOLUME [ "/github/workspace" ] | ||
|
||
WORKDIR /github/distributed-wikipedia-mirror | ||
ENTRYPOINT [ "docker_entrypoint.sh" ] | ||
WORKDIR /root | ||
ENTRYPOINT [ "tools/entrypoint.sh" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.