1 Star 1 Fork 0

chiron / pyspider

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
Dockerfile copy 2.20 KB
一键复制 编辑 原始数据 按行查看 历史
chiron 提交于 2023-03-03 15:05 . no message
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
Python
1
https://gitee.com/hades_c/pyspider.git
git@gitee.com:hades_c/pyspider.git
hades_c
pyspider
pyspider
master

搜索帮助