2020-05-25 00:52:51 +00:00
|
|
|
FROM python:3.7-slim
|
2020-05-24 22:30:57 +00:00
|
|
|
|
|
|
|
WORKDIR /app
|
2020-05-25 00:52:51 +00:00
|
|
|
COPY Pipfile Pipfile.lock /app/
|
2020-05-24 22:30:57 +00:00
|
|
|
|
|
|
|
RUN set -xe \
|
2020-05-25 01:00:46 +00:00
|
|
|
&& pip install pipenv \
|
2020-05-25 00:52:51 +00:00
|
|
|
&& apt-get update -q \
|
|
|
|
&& apt-get install -y -q \
|
|
|
|
gcc python3-dev libssl-dev \
|
|
|
|
curl postgresql-client git-core \
|
|
|
|
gunicorn3 postgresql-client \
|
|
|
|
&& pipenv install --dev \
|
|
|
|
&& apt-get remove -y gcc python3-dev libssl-dev \
|
|
|
|
&& apt-get autoremove -y \
|
|
|
|
&& apt-get clean -y \
|
|
|
|
&& rm -rf /var/lib/apt/lists/* \
|
|
|
|
&& mkdir -p /app \
|
|
|
|
&& useradd _gunicorn --no-create-home --user-group
|
|
|
|
|
|
|
|
COPY . /app/
|
2020-05-24 22:30:57 +00:00
|
|
|
WORKDIR /app
|
2020-05-25 00:52:51 +00:00
|
|
|
ENV FLASK_APP=/app/pb/__init__.py
|
|
|
|
|
|
|
|
# Don't run gunicorn until the DC/OS container actually starts.
|
|
|
|
# Otherwise, environment variables will not be availabele.
|
|
|
|
#CMD ["pipenv", "run", "gunicorn", \
|
|
|
|
# "--bind", "0.0.0.0:8000", \
|
|
|
|
# "-e", "SCRIPT_NAME=/api", \
|
|
|
|
# "crc:app"]
|