From c7d674bec14fb6ecd9ac32bacbac70558cd162f9 Mon Sep 17 00:00:00 2001 From: multi-stager <133181681+multi-stager@users.noreply.github.com> Date: Tue, 4 Feb 2025 10:28:29 +0800 Subject: [PATCH] Update Dockerfile to Multi-Stage --- Dockerfile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 1d67ff945..49668ba96 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,6 @@ # Note: This image is also built in CircleCI, so limit references to internal repositories. -FROM python:3.7 +### Build stage +FROM python:3.7 AS builder # Create app directory WORKDIR /usr/src/app @@ -12,4 +13,9 @@ COPY . /usr/src/app RUN pip install tox==3.15.0 RUN pip install -r requirements.txt +### Runtime stage +FROM python:3.7 +COPY --from=builder /usr/src/app /usr/src/app +WORKDIR /usr/src/app + CMD ["make", "test"]