forked from openstates/openstates-scrapers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
61 lines (51 loc) · 1.85 KB
/
Dockerfile
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
54
55
56
57
58
59
60
61
FROM ubuntu:latest
MAINTAINER James Turk <[email protected]>
ARG DEBIAN_FRONTEND=noninteractive
# add mongo 3.4 packages
RUN echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse" > /etc/apt/sources.list.d/mongodb-org-3.4.list
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6
RUN apt-get update && apt-get install -y \
python2.7 \
python-pip \
python-lxml \
libssl-dev \
mdbtools \
python-dev \
python3-dev \
poppler-utils \
python-virtualenv \
python3.5 \
git \
libpq-dev \
libgeos-dev \
libgdal-dev \
gdal-bin \
s3cmd \
freetds-dev \
curl \
wget \
unzip \
mysql-server \
libmysqlclient-dev \
mongodb-org-tools \
postgresql-client-9.5
RUN mkdir -p /opt/openstates/
RUN mkdir -p /var/run/mysqld/
RUN chown mysql /var/run/mysqld/
RUN virtualenv -p $(which python2) /opt/openstates/venv-billy/
RUN /opt/openstates/venv-billy/bin/pip install -e git+https://github.com/openstates/billy.git#egg=billy
RUN /opt/openstates/venv-billy/bin/pip install -U python-dateutil requests
RUN virtualenv -p $(which python3) /opt/openstates/venv-pupa/
RUN /opt/openstates/venv-pupa/bin/pip install -e git+https://github.com/opencivicdata/python-opencivicdata.git#egg=python-opencivicdata
RUN /opt/openstates/venv-pupa/bin/pip install -e git+https://github.com/opencivicdata/pupa.git#egg=pupa
ENV PYTHONIOENCODING 'utf-8'
ENV LANG 'en_US.UTF-8'
ENV LANGUAGE=en_US:en
ENV LC_ALL=C.UTF-8
ENV PYTHONDONTWRITEBYTECODE=1
ENV BILLY_ENV /opt/openstates/venv-billy/
ENV PUPA_ENV /opt/openstates/venv-pupa/
ADD . /opt/openstates/openstates
RUN /opt/openstates/venv-pupa/bin/pip install -r /opt/openstates/openstates/requirements.txt
WORKDIR /opt/openstates/openstates/
ENTRYPOINT ["/opt/openstates/openstates/pupa-scrape.sh"]