2021-08-09 03:47:25 +00:00
|
|
|
FROM python:3.9-alpine
|
2018-11-02 18:49:35 +00:00
|
|
|
|
|
|
|
ENV PYTHONUNBUFFERED 1
|
|
|
|
|
2021-08-03 00:22:00 +00:00
|
|
|
WORKDIR "/app"
|
|
|
|
|
|
|
|
RUN set -ex; \
|
2021-08-04 17:09:25 +00:00
|
|
|
pip3 install \
|
|
|
|
--no-cache-dir --no-color --disable-pip-version-check --no-python-version-warning \
|
|
|
|
pipenv \
|
|
|
|
;
|
2021-08-03 00:22:00 +00:00
|
|
|
|
|
|
|
COPY Pipfile Pipfile.lock ./
|
|
|
|
|
|
|
|
RUN set -ex; \
|
2021-08-04 17:09:25 +00:00
|
|
|
# install prerequisites
|
2021-08-04 01:46:57 +00:00
|
|
|
apk add --no-cache \
|
2021-08-04 17:09:25 +00:00
|
|
|
g++ \
|
|
|
|
jpeg-dev \
|
|
|
|
zlib-dev \
|
2021-08-03 00:22:00 +00:00
|
|
|
; \
|
2021-08-04 17:09:25 +00:00
|
|
|
# build/install local packages
|
|
|
|
pipenv install --deploy; \
|
|
|
|
pipenv --clear; \
|
|
|
|
# remove build-only prerequisites
|
|
|
|
apk del --no-cache \
|
|
|
|
g++ \
|
|
|
|
;
|
2018-11-02 18:49:35 +00:00
|
|
|
|
|
|
|
COPY . .
|
|
|
|
|
2021-08-03 00:22:00 +00:00
|
|
|
ENTRYPOINT ["pipenv", "run", "./main.py"]
|