forked from kompetenzinventar/ki-backend
35 lines
600 B
Docker
35 lines
600 B
Docker
FROM python:3.8-alpine as base
|
|
|
|
ENV PYROOT /pyroot
|
|
ENV PYTHONUSERBASE $PYROOT
|
|
|
|
|
|
FROM base as builder
|
|
|
|
RUN apk add --no-cache \
|
|
gcc \
|
|
g++ \
|
|
musl-dev \
|
|
python3-dev && \
|
|
pip3 install pipenv
|
|
|
|
COPY Pipfile* ./
|
|
|
|
RUN PIP_USER=1 PIP_IGNORE_INSTALLED=1 pipenv install --system --deploy --ignore-pipfile
|
|
RUN pip3 uninstall --yes pipenv
|
|
|
|
|
|
FROM base
|
|
|
|
# Install six explicitly. Otherwise Python complains about it missing.
|
|
RUN pip3 install six
|
|
|
|
COPY --from=builder $PYROOT/bin/ $PYROOT/bin/
|
|
COPY --from=builder $PYROOT/lib/ $PYROOT/lib/
|
|
|
|
WORKDIR /app
|
|
|
|
COPY . .
|
|
|
|
CMD ["python3", "run_prod.py"]
|