pyspider/Dockerfile

41 lines
1.4 KiB
Docker
Raw Permalink Normal View History

2019-10-24 19:10:08 +08:00
FROM python:3.6
2014-10-08 14:32:35 +08:00
MAINTAINER binux <roy@binux.me>
2017-03-06 07:32:22 +08:00
# install phantomjs
RUN mkdir -p /opt/phantomjs \
&& cd /opt/phantomjs \
&& wget -O phantomjs.tar.bz2 https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2 \
&& tar xavf phantomjs.tar.bz2 --strip-components 1 \
&& ln -s /opt/phantomjs/bin/phantomjs /usr/local/bin/phantomjs \
&& rm phantomjs.tar.bz2
2019-10-24 22:03:48 +08:00
# Fix Error: libssl_conf.so: cannot open shared object file: No such file or directory
ENV OPENSSL_CONF=/etc/ssl/
2017-03-06 07:32:22 +08:00
2019-02-14 17:08:23 +08:00
# install nodejs
ENV NODEJS_VERSION=8.15.0 \
PATH=$PATH:/opt/node/bin
2019-02-14 17:08:23 +08:00
WORKDIR "/opt/node"
RUN apt-get -qq update && apt-get -qq install -y curl ca-certificates libx11-xcb1 libxtst6 libnss3 libasound2 libatk-bridge2.0-0 libgtk-3-0 --no-install-recommends && \
curl -sL https://nodejs.org/dist/v${NODEJS_VERSION}/node-v${NODEJS_VERSION}-linux-x64.tar.gz | tar xz --strip-components=1 && \
rm -rf /var/lib/apt/lists/*
2019-10-25 00:29:06 +08:00
RUN npm install puppeteer express
2014-10-08 14:32:35 +08:00
2014-10-09 22:58:47 +08:00
# install requirements
2017-03-06 07:32:22 +08:00
COPY requirements.txt /opt/pyspider/requirements.txt
2015-04-11 16:36:45 +08:00
RUN pip install -r /opt/pyspider/requirements.txt
2014-10-08 14:32:35 +08:00
2014-10-09 22:58:47 +08:00
# add all repo
ADD ./ /opt/pyspider
# run test
2014-10-08 14:32:35 +08:00
WORKDIR /opt/pyspider
2016-04-07 03:09:46 +08:00
RUN pip install -e .[all]
2014-10-08 17:43:10 +08:00
2019-10-25 01:42:50 +08:00
# Create a symbolic link to node_modules
RUN ln -s /opt/node/node_modules ./node_modules
2019-10-24 22:03:48 +08:00
#VOLUME ["/opt/pyspider"]
ENTRYPOINT ["pyspider"]
2014-10-08 14:32:35 +08:00
2019-02-14 17:08:23 +08:00
EXPOSE 5000 23333 24444 25555 22222