代码拉取完成,页面将自动刷新
FROM python:3.10.9-alpine3.17
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
RUN apk update \
&& apk upgrade \
&& apk add --no-cache bash git\
bash-doc \
bash-completion
# RUN apk add --no-cache phantomjs
# RUN git clone https://gitee.com/spower/phantomjs.git /phantomjs && cd /phantomjs && git checkout 2.0 && ./build.sh
# install phantomjs
# RUN mkdir -p /opt/phantomjs
# && wget -O phantomjs.tar.bz2 https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2 \
# COPY ./docker/phantomjs.tar.bz2 /opt/phantomjs
# RUN cd /opt/phantomjs && tar -xvf /opt/phantomjs/phantomjs.tar.bz2 --strip-components 1 \
# && ln -s /opt/phantomjs/bin/phantomjs /usr/local/bin/phantomjs \
# && rm phantomjs.tar.bz2
# Fix Error: libssl_conf.so: cannot open shared object file: No such file or directory
ENV OPENSSL_CONF=/etc/ssl/
# install nodejs
ENV NODEJS_VERSION=8.15.0 \
PATH=$PATH:/opt/node/bin
WORKDIR "/opt/node"
RUN apk add --no-cache curl ca-certificates alsa-lib-dev gcc g++ libffi-dev nodejs npm git make libx11-dev libsecret-dev pkgconfig chromium curl-dev libxml2 libxslt libxml2-dev
RUN apk add --no-cache postgresql-dev nodejs npm python3-dev python3-dev
RUN apk add --no-cache libxslt-dev musl-dev
# g++ gcc libxslt-dev python3-dev openssl-dev gcc musl-dev libxslt-dev
# RUN curl -sL https://nodejs.org/dist/v${NODEJS_VERSION}/node-v${NODEJS_VERSION}-linux-x64.tar.gz | tar -xz --strip-components=1
RUN npm config set registry https://registry.npm.taobao.org
RUN npm install -g npm@6.14.16
RUN npm install puppeteer@18.1.0 express
RUN npm install phantomjs
# install requirements
COPY requirements.txt /opt/pyspider/requirements.txt
RUN pip3 install --upgrade pip -i https://pypi.tuna.tsinghua.edu.cn/simple/
RUN pip3 install -r /opt/pyspider/requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple/
# add all repo
ADD ./ /opt/pyspider
# run test
WORKDIR /opt/pyspider
RUN pip install -e .[all]
# Create a symbolic link to node_modules
RUN ln -s /opt/node/node_modules ./node_modules
RUN rm -rf /var/cache/apk/* && rm -rf ~/.cache/pip
#VOLUME ["/opt/pyspider"]
ENTRYPOINT ["pyspider"]
EXPOSE 5000 23333 24444 25555 22222
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。