From 8d9315cf3a582255e1ebe2f23b67b8ebc7193d30 Mon Sep 17 00:00:00 2001 From: liamcottle Date: Wed, 25 Dec 2024 20:09:00 +1300 Subject: [PATCH] optimise docker file as python deps should rarely change --- Dockerfile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8212092..268fb1c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,6 +3,7 @@ FROM node:20-bookworm-slim AS build-frontend WORKDIR /src +# Copy required source files COPY *.json . COPY *.js . COPY src/frontend ./src/frontend @@ -16,11 +17,14 @@ FROM python:3.11-bookworm WORKDIR /app +# Install Python deps COPY ./requirements.txt . -COPY --from=build-frontend /src/public public - RUN pip install -r requirements.txt +# Copy prebuilt frontend +COPY --from=build-frontend /src/public public + +# Copy other required source files COPY *.py . COPY src/__init__.py ./src/__init__.py COPY src/backend ./src/backend