Skip to content

Commit 68c95db

Browse files
committed
Fix cache busting by updating default CACHEBUST value
1 parent 58d3bc0 commit 68c95db

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

docker/Dockerfile.fly

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
FROM python:3.12-slim
22

3-
# Cache busting argument (set during build to force fresh layers)
4-
ARG CACHEBUST=4
5-
6-
# Use CACHEBUST to invalidate cache when needed (this layer changes when CACHEBUST changes)
7-
RUN echo "Cache bust: $CACHEBUST" > /tmp/cachebust
8-
93
# Install system dependencies including nginx
104
RUN apt-get update && apt-get install -y --no-install-recommends \
115
git \
@@ -20,17 +14,24 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
2014

2115
WORKDIR /opt/dagster/app
2216

23-
# Copy requirements and install Python dependencies
17+
# Copy requirements and install Python dependencies (these change less frequently)
2418
COPY requirements.txt requirements-dashboard.txt ./
2519
RUN pip install --no-cache-dir -r requirements.txt && \
2620
pip install --no-cache-dir -r requirements-dashboard.txt
2721

28-
# Copy application code
22+
# Cache busting argument (set during build to force fresh layers)
23+
ARG CACHEBUST=5
24+
25+
# Use CACHEBUST to invalidate cache when needed (this layer changes when CACHEBUST changes)
26+
# This must come BEFORE copying application code to ensure fresh code on force rebuild
27+
RUN echo "Cache bust: $CACHEBUST" > /tmp/cachebust
28+
29+
# Copy application code (this will now be invalidated by CACHEBUST when force rebuilding)
2930
COPY anomstack ./anomstack
3031
COPY dashboard ./dashboard
3132
COPY metrics ./metrics
3233

33-
# Capture git commit hash for version info
34+
# Capture git commit hash for version info (must be after code copy to track the right version)
3435
ARG ANOMSTACK_BUILD_HASH
3536
ENV ANOMSTACK_BUILD_HASH=${ANOMSTACK_BUILD_HASH}
3637

0 commit comments

Comments
 (0)