Skip to content

Commit

Permalink
optimise docker file as python deps should rarely change
Browse files Browse the repository at this point in the history
  • Loading branch information
liamcottle committed Dec 25, 2024
1 parent 1160d10 commit 8d9315c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 8d9315c

Please sign in to comment.