1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2024-11-24 08:52:15 +02:00
This commit is contained in:
kev 2015-05-28 07:21:59 +08:00
parent b64f1402c4
commit 1ba3d0196a
3 changed files with 28 additions and 23 deletions

View File

@ -10,33 +10,36 @@
#
FROM ubuntu:14.04
MAINTAINER kev
MAINTAINER kev <noreply@datageek.info>
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 627220E7
RUN echo 'deb http://archive.scrapy.org/ubuntu scrapy main' >/etc/apt/sources.list.d/scrapy.list
RUN apt-get update &&\
apt-get install -y\
git\
libpq-dev\
build-essential\
python-dev\
python-pip\
python-numpy\
python-txzmq\
scrapy-0.24\
scrapyd &&\
apt-get clean
RUN rm -rf /var/lib/apt/lists/*
RUN mkdir /var/log/supervisor/
ADD ./requirements.txt /tmp/
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 627220E7 \
&& echo 'deb http://archive.scrapy.org/ubuntu scrapy main' > /etc/apt/sources.list.d/scrapy.list \
&& apt-get update \
&& apt-get install -y git \
libpq-dev \
build-essential \
python-dev \
python-pip \
python-numpy \
python-txzmq \
scrapy-0.24 \
scrapyd \
supervisor \
&& pip install -r /tmp/requirements.txt \
&& apt-get remove -y build-essential \
&& apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir /var/log/supervisor/
ADD ./001-scrapyd /etc/scrapyd/conf.d/
ADD ./requirements.txt /tmp/
ADD ./supervisord.conf /etc/supervisor/supervisord.conf
WORKDIR /tmp
RUN pip install -r requirements.txt
VOLUME /var/lib/scrapyd
EXPOSE 6800 9001
CMD supervisord -c /etc/supervisor/supervisord.conf
CMD supervisord -n -c /etc/supervisor/supervisord.conf

View File

@ -17,6 +17,5 @@ redis
# others
chardet
requests
supervisor
toolz

View File

@ -16,5 +16,8 @@ nodaemon=true
serverurl=http://localhost:9001
[program:scrapyd]
command = /usr/bin/scrapyd -u scrapy -g nogroup --pidfile /var/run/scrapyd.pid -l /var/log/scrapyd/scrapyd.log
command = /usr/bin/scrapyd -u scrapy
-g nogroup
--pidfile /var/run/scrapyd.pid
-l /var/log/scrapyd/scrapyd.log