/
box-Dockerfile
executable file
·29 lines (29 loc) · 1.68 KB
/
box-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
FROM python:3.7
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
ENV PYTHONUNBUFFERED=1
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y curl unzip wget jq xvfb firefox-esr tor iptables-persistent iptables net-tools supervisor tcpdump libtesseract-dev libleptonica-dev tesseract-ocr
COPY box-requirements.txt .
RUN pip install -r box-requirements.txt --use-deprecated=legacy-resolver
RUN GECKOVERSION=`curl -sL https://api.github.com/repos/mozilla/geckodriver/releases/latest | jq -r ".tag_name"` && \
wget https://github.com/mozilla/geckodriver/releases/download/$GECKOVERSION/geckodriver-$GECKOVERSION-linux64.tar.gz && \
tar -zxf geckodriver-$GECKOVERSION-linux64.tar.gz -C /usr/local/bin && \
chmod +x /usr/local/bin/geckodriver
RUN CHROMEDRIVER=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE` && \
wget https://chromedriver.storage.googleapis.com/$CHROMEDRIVER/chromedriver_linux64.zip -O chromedriver_linux64.zip && \
unzip chromedriver_linux64.zip -d /usr/bin && \
chmod +x /usr/bin/chromedriver
RUN CHROME=google-chrome.deb && \
wget "https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb" -O $CHROME && \
dpkg -i $CHROME || true && \
apt-get install -y -f
RUN PHANTOMJS=`curl -sL https://bitbucket.org/ariya/phantomjs/downloads/ | grep -E -o 'phantomjs-[0-9]{1,2}.[0-9]{1,2}.[0-9]{1,2}-linux-x86_64.tar.bz2' | head -n 1` && \
wget https://bitbucket.org/ariya/phantomjs/downloads/$PHANTOMJS -O $PHANTOMJS && \
tar -jxf $PHANTOMJS && \
cp $PHANTOMJS /usr/local/bin/phantomjs
COPY ./box/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
RUN mkdir /output
ADD ./box ./box
WORKDIR box
ENTRYPOINT ["python", "run.py"]