forked from propublica/politwoops_sunlight
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile.worker
More file actions
53 lines (41 loc) · 1.92 KB
/
Copy pathDockerfile.worker
File metadata and controls
53 lines (41 loc) · 1.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
FROM ruby:2.2
RUN apt-get update --fix-missing
# application dependencies
RUN apt-get install -y libmysqlclient-dev libpq-dev libcurl4-openssl-dev nodejs
RUN apt-get install -y wget python-setuptools python-dev
RUN echo "gem: --no-ri --no-rdoc" > ~/.gemrc
WORKDIR /web/
ADD Gemfile /web/
ADD Gemfile.lock /web/
ADD ./vendor/cache /web/vendor/cache
RUN bundle install --deployment --without development --jobs=2
ADD . /web/
ENV RAILS_ENV production
ENV PHANTOMJS_VERSION 2.1.1
# Commands
RUN \
apt-get install -y vim git wget libfreetype6 libfontconfig bzip2 && \
mkdir -p /srv/var
RUN wget -q --no-check-certificate -O /tmp/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2
RUN tar -xjf /tmp/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2 -C /tmp
RUN rm -f /tmp/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2
RUN mv /tmp/phantomjs-$PHANTOMJS_VERSION-linux-x86_64/ /srv/var/phantomjs
RUN ln -s /srv/var/phantomjs/bin/phantomjs /usr/local/bin/phantomjs
RUN git clone https://github.com/casperjs/casperjs.git /srv/var/casperjs
RUN ln -s /srv/var/casperjs/bin/casperjs /usr/local/bin/casperjs
RUN apt-get install -y beanstalkd
RUN git clone --depth 1 https://github.com/propublica/politwoops-tweet-collector.git && \
mkdir -p /web/tmp/tweet-images && \
easy_install pip && \
pip install -r politwoops-tweet-collector/requirements.txt
ADD config/tweets-client.ini /web/politwoops-tweet-collector/conf/tweets-client.ini
RUN mkdir -p /web/data/heartbeats
RUN mkdir -p /web/tmp/tweet-images
RUN ["chmod", "+x", "bin/run-collector-dockercmd"]
RUN ["chmod", "+x", "/web/bin/run-tweets-client"]
RUN ["chmod", "+x", "/web/bin/run-politwoops-worker"]
RUN ["chmod", "+x", "/web/bin/run-screenshot-worker"]
# Clean up APT when done.
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
VOLUME ["/data"]
CMD bin/run-collector-dockercmd