-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #201 from openzim/lang
crawler 0.10.2
- Loading branch information
Showing
4 changed files
with
44 additions
and
23 deletions.
There are no files selected for viewing
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 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 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,33 +1,35 @@ | ||
FROM webrecorder/browsertrix-crawler:0.10.0-beta.4 | ||
FROM webrecorder/browsertrix-crawler:0.10.2 | ||
LABEL org.opencontainers.image.source https://github.com/openzim/zimit | ||
|
||
RUN apt-get update && apt-get install -qqy --no-install-recommends libmagic1 && apt-get clean && rm -rf /var/lib/apt/lists/* | ||
|
||
# temp (needs warc2zim release on zimit release) | ||
RUN pip3 install --no-cache-dir 'requests>=2.24.0' 'inotify==0.2.10' 'tld>=0.12,<0.13' 'warc2zim==1.5.1' && \ | ||
pip3 uninstall -y warc2zim && \ | ||
pip3 install 'git+https://github.com/openzim/warc2zim@main#egg_name=warc2zim' | ||
|
||
RUN mkdir -p /output | ||
|
||
WORKDIR /app | ||
|
||
# download list of bad domains to filter-out. intentionnaly ran post-install | ||
# so it's not cached in earlier layers (url stays same but content updated) | ||
RUN mkdir -p /tmp/ads && cd /tmp/ads && \ | ||
RUN apt-get update \ | ||
&& apt-get install -qqy --no-install-recommends \ | ||
libmagic1 \ | ||
python3.10-venv \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
# python setup (in venv not to conflict with browsertrix) | ||
&& python3 -m venv /app/zimit \ | ||
&& /app/zimit/bin/python -m pip install --no-cache-dir 'requests==2.31.0' 'inotify==0.2.10' 'tld==0.13' 'warc2zim==1.5.2' \ | ||
# placeholder (default output location) | ||
&& mkdir -p /output \ | ||
# disable chrome upgrade | ||
&& printf "repo_add_once=\"false\"\nrepo_reenable_on_distupgrade=\"false\"\n" > /etc/default/google-chrome \ | ||
# download list of bad domains to filter-out. intentionnaly ran post-install \ | ||
# so it's not cached in earlier layers (url stays same but content updated) \ | ||
mkdir -p /tmp/ads && cd /tmp/ads && \ | ||
curl -L -O https://hosts.anudeep.me/mirror/adservers.txt && \ | ||
curl -L -O https://hosts.anudeep.me/mirror/CoinMiner.txt && \ | ||
curl -L -O https://hosts.anudeep.me/mirror/facebook.txt && \ | ||
cat ./*.txt > /etc/blocklist.txt \ | ||
&& rm ./*.txt | ||
RUN printf '#!/bin/sh\ncat /etc/blocklist.txt >> /etc/hosts\nexec "$@"' > /usr/local/bin/entrypoint.sh && \ | ||
&& rm ./*.txt \ | ||
&& printf '#!/bin/sh\ncat /etc/blocklist.txt >> /etc/hosts\nexec "$@"' > /usr/local/bin/entrypoint.sh && \ | ||
chmod +x /usr/local/bin/entrypoint.sh | ||
|
||
WORKDIR /app | ||
ADD zimit.py /app/ | ||
|
||
RUN ln -s /app/zimit.py /usr/bin/zimit | ||
|
||
RUN printf "repo_add_once=\"false\"\nrepo_reenable_on_distupgrade=\"false\"\n" > /etc/default/google-chrome | ||
# fix shebang on zimit to use in-venv python | ||
RUN sed -i.bak "1 s/.*/#!\/app\/zimit\/bin\/python3/" /app/zimit.py \ | ||
&& ln -s /app/zimit.py /usr/bin/zimit \ | ||
&& chmod +x /usr/bin/zimit | ||
|
||
ENTRYPOINT ["entrypoint.sh"] | ||
CMD ["zimit"] |
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