forked from opt-out-tools/public_api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
47 lines (38 loc) · 1.11 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
FROM python:3.7.4-slim-buster
ENV YOUR_ENV=${YOUR_ENV} \
PYTHONFAULTHANDLER=1 \
PYTHONUNBUFFERED=1 \
PYTHONHASHSEED=random \
PIP_NO_CACHE_DIR=off \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100 \
POETRY_VERSION=0.12.17
RUN apt-get update && apt-get install -y \
build-essential \
curl \
gcc \
gettext \
git \
libffi-dev \
musl-dev \
libpq-dev \
postgresql-contrib \
tini \
libhdf5-serial-dev \
gfortran \
liblapack-dev \
&& pip install -U "pip<19.0" \
&& pip install "poetry==$POETRY_VERSION"
RUN poetry config settings.virtualenvs.create false
WORKDIR /usr/src/app
COPY poetry.lock poetry.lock
COPY pyproject.toml pyproject.toml
RUN touch README.md
RUN mkdir -p /usr/src/app/src/opt_out && touch /usr/src/app/src/opt_out/__init__.py
RUN poetry install --no-interaction --no-ansi --no-dev
RUN pip install gunicorn
COPY README.md README.md
COPY src src
COPY manage.py manage.py
ENTRYPOINT ["tini", "--"]
CMD python manage.py migrate && gunicorn opt_out.public_api.website.wsgi:application --workers 2 --bind 0.0.0.0:8000