Skip to content

Commit

Permalink
Add a separate build stage for things that need compiling
Browse files Browse the repository at this point in the history
  • Loading branch information
jerith committed Mar 28, 2023
1 parent aae4048 commit b99680b
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
FROM ghcr.io/praekeltfoundation/pypy-base-nw:2-buster
FROM ghcr.io/praekeltfoundation/pypy-base-nw:2-buster AS builder

RUN addgroup --system vumi \
&& adduser --system --ingroup vumi vumi
RUN apt-get update
RUN apt-get -yy install build-essential libssl-dev libffi-dev

COPY requirements.txt /requirements.txt

RUN pip install --upgrade pip
# We need the backport of the typing module to build Twisted.
RUN pip install typing==3.10.0.0

COPY requirements.txt /requirements.txt
RUN pip install -r /requirements.txt
RUN pip wheel -w /wheels -r /requirements.txt


FROM ghcr.io/praekeltfoundation/pypy-base-nw:2-buster

COPY ./requirements.txt /requirements.txt
COPY --from=builder /wheels /wheels
RUN pip install -f /wheels -r /requirements.txt

RUN addgroup --system vumi \
&& adduser --system --ingroup vumi vumi

WORKDIR /app

Expand Down

0 comments on commit b99680b

Please sign in to comment.