docker(major): use buster instead of stretch, simplify base image, use pyuwsgi for wheels

This commit is contained in:
Langhammer, Jens
2019-10-10 17:13:06 +02:00
parent ef6ef68a39
commit 8ff9e72972
5 changed files with 51 additions and 21 deletions

View File

@ -1,18 +1,19 @@
FROM python:3.7-slim-stretch
FROM python:3.7-slim-buster as locker
COPY ./Pipfile /app/
COPY ./Pipfile.lock /app/
WORKDIR /app/
RUN apt-get update && \
apt-get install -y --no-install-recommends build-essential && \
pip install pipenv uwsgi --no-cache-dir && \
apt-get remove -y --purge build-essential && \
apt-get autoremove -y --purge && \
rm -rf /var/lib/apt/lists/*
RUN pip install pipenv && \
pipenv lock -r > requirements.txt && \
pipenv lock -rd > requirements-dev.txt
RUN pipenv lock -r > requirements.txt && \
pipenv --rm && \
pip install -r requirements.txt --no-cache-dir && \
FROM python:3.7-slim-buster
COPY --from=locker /app/requirements.txt /app/
WORKDIR /app/
RUN pip install -r requirements.txt --no-cache-dir && \
adduser --system --no-create-home --uid 1000 --group --home /app passbook