-
Notifications
You must be signed in to change notification settings - Fork 200
/
Dockerfile
62 lines (53 loc) · 1.59 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
62
# Dockerization of Congress:
#
# This Docker image will create a minimal environment to run the Congress
# scrapers in. This provides isolation from the host, and allows testing
# in an environment that's as close to production as you can.
#
#
# You can build this image by running:
#
# docker build --rm -t unitedstates/congress .
#
#
# Running the scraper should be as easy as:
#
# export CONGRESS_OUTPUT_DIR=/tmp/congres
#
# docker run \
# -t --rm \
# -v ${CONGRESS_OUTPUT_DIR}:/congress \
# unitedstates/congress \
# ...
#
#
# Where [...] is something like `bills`, or any other arguments to the
# `run` script.
#
# The data produced by the scrape will end up at ${CONGRESS_OUTPUT_DIR}
# on the host. This path may be any path on the host.
#
# One good pattern is to write this out to the /srv/ tree, for example,
# /srv/pault.ag/congress/ or /srv/io.unitedstates/congress/
FROM debian:bullseye
LABEL maintainer="Paul R. Tagliamonte <[email protected]>"
RUN apt-get update && apt-get install -y \
git \
python3 \
python3-dev \
python3-pip \
libxml2-dev \
libxslt1-dev \
libz-dev \
wget \
&& rm -rf /var/lib/apt/lists/*
RUN pip3 install --upgrade pip setuptools wheel
RUN mkdir -p /opt/theunitedstates.io/
ADD . /opt/theunitedstates.io/congress/
WORKDIR /opt/theunitedstates.io/congress/
RUN pip3 install .
RUN ln -s /usr/bin/python3 /usr/bin/python
RUN echo "/opt/theunitedstates.io/congress/" > /usr/local/lib/python3.9/dist-packages/congress.pth
RUN mkdir -p /congress
WORKDIR /congress
CMD ["/bin/bash"]