Change Dockerfile ordering
This commit is contained in:
@@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
# nuzlocke-tracker-yz9t
|
||||||
|
title: Optimize backend dev Dockerfile layer caching
|
||||||
|
status: completed
|
||||||
|
type: task
|
||||||
|
priority: normal
|
||||||
|
created_at: 2026-02-13T14:45:23Z
|
||||||
|
updated_at: 2026-02-13T14:47:48Z
|
||||||
|
---
|
||||||
|
|
||||||
|
Seed data changes (11MB in src/app/seeds/) invalidate the pip install layer because COPY src/ comes before RUN pip install -e. Fix by creating a minimal package stub before pip install, then copying full source after.
|
||||||
@@ -10,10 +10,15 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
|||||||
|
|
||||||
# Install Python dependencies
|
# Install Python dependencies
|
||||||
COPY pyproject.toml README.md alembic.ini ./
|
COPY pyproject.toml README.md alembic.ini ./
|
||||||
COPY src/ ./src/
|
|
||||||
|
# Create minimal package stub so editable install can resolve the package
|
||||||
|
RUN mkdir -p src/app && touch src/app/__init__.py
|
||||||
|
|
||||||
RUN pip install --no-cache-dir -e .
|
RUN pip install --no-cache-dir -e .
|
||||||
|
|
||||||
|
# Copy source (will be overridden by volume mount in dev)
|
||||||
|
COPY src/ ./src/
|
||||||
|
|
||||||
# Expose port
|
# Expose port
|
||||||
EXPOSE 8000
|
EXPOSE 8000
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user