1+ # FROM ubuntu:16.04
2+
3+ FROM python:3.7.9-alpine3.12
4+
5+ Label author "qboy0000<2006qgw@163.com>"
6+
7+ # COPY dist/floodlight /root/floodlight
8+
9+ ENV XARY 1.7.0
10+ ENV PYTHON3 3.7.9
11+ ENV CHROMEDRIVER_VERSION 88.0.4324.96
12+
13+ # RUN sed -i 's/http:\/\/archive.ubuntu.com/http:\/\/mirrors.huaweicloud.com/g' /etc/apt/sources.list && \
14+ # sed -i 's/http:\/\/security.ubuntu.com/http:\/\/mirrors.huaweicloud.com/g' /etc/apt/sources.list && \
15+ # apt-get update && \
16+
17+ COPY ./requirement.txt /tmp/
18+
19+ RUN set -x && sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \
20+ apk update && \
21+ # GM+8
22+ # set time zone
23+ apk add --no-cache tzdata && \
24+ echo "Asia/Shanghai" > /etc/timezone && \
25+ cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
26+ # dpkg-reconfigure -f noninteractive tzdata && \
27+ apk add --no-cache musl-dev linux-headers git wget curl unzip mysql-client mariadb-dev make gcc chromium chromium-chromedriver && \
28+
29+ # update python3 to 3.7
30+ # wget https://www.python.org/ftp/python/$PYTHON3/Python-$PYTHON3.tar.xz -O /tmp/Python-$PYTHON3.tar.xz && \
31+ # cd /tmp && tar -xvf Python-$PYTHON3.tar.xz && cd Python-$PYTHON3 && ./configure && make && make install && \
32+
33+ git clone --depth 1 https://github.com/knownsec/LSpider.git /opt/LSpider && \
34+
35+ cd /opt/LSpider/ && \
36+ pip3 install -r /tmp/requirement.txt -i https://mirrors.aliyun.com/pypi/simple && \
37+
38+ wget https://download.xray.cool/xray/$XARY/xray_linux_amd64.zip -O /tmp/xray_linux_amd64.zip && \
39+ mkdir -p /opt/xray && \
40+ unzip /tmp/xray_linux_amd64.zip -d /opt/xray && \
41+
42+ # wget http://npm.taobao.org/mirrors/chromedriver/$CHROMEDRIVER_VERSION/chromedriver_linux64.zip -O /tmp/chromedriver_linux64.zip && \
43+ # mkdir /opt/LSpider/bin && \
44+ # unzip /tmp/chromedriver_linux64.zip -d /usr/bin && \
45+ # mv /usr/bin/chromedriver /usr/bin/chromedriver_linux64 && \
46+
47+ rm -rf /tmp/*
48+
49+ WORKDIR /opt/LSpider/
50+ COPY ./docker-entrypoint.sh /opt/LSpider/docker-entrypoint.sh
51+ COPY ./settings.py.docker.bak /opt/LSpider/LSpider/settings.py
52+ COPY ./xray.sh /opt/LSpider/xray.sh
53+ COPY ./chromeheadless.py /opt/LSpider/core/
54+
55+ RUN chmod a+x /opt/LSpider/*.sh
56+
57+ EXPOSE 2062
58+
59+ CMD /opt/LSpider/docker-entrypoint.sh
0 commit comments