-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathcrawler.Dockerfile
43 lines (37 loc) · 1.49 KB
/
crawler.Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
FROM ubuntu:jammy
SHELL ["/bin/bash", "-c"]
RUN set -exuo pipefail; \
apt-get update && apt-get install -y \
ca-certificates \
fonts-ipafont \
jq \
libnss3-tools \
python3 \
python3-pip \
unzip \
wget; \
wget -q -O - 'https://dl-ssl.google.com/linux/linux_signing_key.pub' | apt-key add -; \
echo 'deb http://dl.google.com/linux/chrome/deb/ stable main' >> /etc/apt/sources.list.d/google.list; \
apt-get update; \
DEBIAN_FRONTEND=noninteractive apt-get install -y google-chrome-stable; \
apt-get clean && rm -rf /var/lib/apt/lists/*; \
pip3 install -U pip && pip3 install -U \
boto3 \
jsonschema \
mitmproxy \
pyyaml \
redis \
selenium; \
wget "$(wget -qO - 'https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json' | jq -r '.channels.Stable.downloads.chromedriver[]|select(.platform == "linux64").url')"; \
unzip chromedriver-linux64.zip -d /usr/local/bin; \
rm chromedriver-linux64.zip; \
useradd -ms /bin/bash ubuntu; \
mkdir -p /opt/mahjongsoul-sniffer; \
chown -R ubuntu /opt/mahjongsoul-sniffer; \
mkdir -p /var/log/mahjongsoul-sniffer; \
chown -R ubuntu /var/log/mahjongsoul-sniffer
USER ubuntu
WORKDIR /opt/mahjongsoul-sniffer
ENV PYTHONPATH=/opt/mahjongsoul-sniffer
ENV PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python
ENTRYPOINT ["bin/run-with-sniffer", "game-abstract-crawler/sniffer.py", "game-abstract-crawler/crawler.py"]