forked from openstates/openstates-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
37 lines (32 loc) · 992 Bytes
/
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
FROM python:3.9-slim
LABEL maintainer="James Turk <[email protected]>"
ENV PYTHONUNBUFFERED 1
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONIOENCODING 'utf-8'
ENV LANG 'C.UTF-8'
ENV PYTHONPATH ${PYTHONPATH}:.:/opt/os
# text extraction stuff
# install git for forked dependency re: scrapelib
RUN apt-get update -qq && apt-get install -y -qq --no-install-recommends \
libgdal-dev \
poppler-utils \
antiword \
tesseract-ocr \
git \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& mkdir -p /opt/os
WORKDIR /opt/os
ADD pyproject.toml /opt/os/
ADD poetry.lock /opt/os/
RUN pip --no-cache-dir --disable-pip-version-check install poetry \
&& poetry install -q --no-root \
&& apt-get -y -qq remove \
git \
&& apt-get autoremove -y -qq \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
ADD . /opt/os
RUN poetry install -q \
&& rm -r /root/.cache/pypoetry/cache /root/.cache/pypoetry/artifacts/
ENTRYPOINT ["poetry", "run"]