New builder, better dockerfile
parent
e9f2922d7f
commit
da7d39d84e
@ -1,13 +1,23 @@
|
||||
FROM debian:11
|
||||
FROM python:3.9-slim as builder
|
||||
|
||||
MAINTAINER Paul Warren <pwarren@pwarren.id.au>
|
||||
WORKDIR /app
|
||||
|
||||
RUN apt-get update -y && apt-get install -y python3-pip python3-dev
|
||||
RUN apt-get update -y && apt-get install -y --no-install-recommends gcc
|
||||
COPY requirements.txt .
|
||||
RUN pip3 wheel --no-cache-dir --no-deps --wheel-dir /app/wheels -r requirements.txt
|
||||
|
||||
ADD . /app
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN pip3 install -r requirements.txt
|
||||
FROM python:3.9-slim
|
||||
ARG VERSION
|
||||
ENV VERSION $VERSION
|
||||
ARG BUILD_TIMESTAMP
|
||||
ENV BUILD_TIMESTAMP $BUILD_TIMESTAMP
|
||||
|
||||
MAINTAINER Paul Warren <pwarren@pwarren.id.au>
|
||||
WORKDIR /app
|
||||
COPY --from=builder /app/wheels /wheels
|
||||
COPY --from=builder /app/requirements.txt /
|
||||
RUN pip install --no-cache /wheels/*
|
||||
ADD . /app
|
||||
ENTRYPOINT ["./gunicorn_start.sh"]
|
||||
|
||||
|
Loading…
Reference in New Issue