This repository has been archived by the owner on Jun 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
10 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,18 @@ | ||
FROM cmfatih/phantomjs | ||
FROM python:2.7 | ||
MAINTAINER binux <[email protected]> | ||
|
||
# install python | ||
RUN apt-get update && \ | ||
apt-get install -y python python-dev python-distribute python-pip && \ | ||
apt-get install -y libcurl4-openssl-dev libxml2-dev libxslt1-dev python-lxml python-mysqldb libpq-dev | ||
# 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 | ||
|
||
|
||
# install requirements | ||
RUN pip install -U pip setuptools | ||
RUN pip install --egg 'https://dev.mysql.com/get/Downloads/Connector-Python/mysql-connector-python-2.1.5.zip#md5=ce4a24cb1746c1c8f6189a97087f21c1' | ||
ADD requirements.txt /opt/pyspider/requirements.txt | ||
COPY requirements.txt /opt/pyspider/requirements.txt | ||
RUN pip install -r /opt/pyspider/requirements.txt | ||
|
||
# add all repo | ||
|
124b9f2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mysql-connector-python-2.1.5 is not support for python:2.7,also the docker image "binux/pyspider"has wrong "ImportError: No module named MySQLdb" ,To solve this problem use "pip install MySQL-python" instead it or update python to 3.0+.