Skip to content

Commit

Permalink
Multistage build common base
Browse files Browse the repository at this point in the history
  • Loading branch information
radupotop committed Apr 5, 2024
1 parent 02ff5b2 commit 59bd961
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
FROM python:3.11.8-slim AS base
RUN apt-get update && apt-get -y install iptables

# Builder
FROM python:3.11.8-slim AS builder
RUN apt-get update && apt-get -y install gcc iptables
FROM base AS builder
RUN apt-get -y install gcc
COPY . /app
WORKDIR /app
RUN pip wheel . -w /wheels/


# Runner
FROM python:3.11.8-slim
RUN apt-get update && apt-get -y install iptables
FROM base AS runner
COPY --from=builder /wheels /wheels
RUN pip install /wheels/*
COPY . /app
Expand Down

0 comments on commit 59bd961

Please sign in to comment.