Skip to content

Commit b92effa

Browse files
Copilotdannystaple
andcommitted
Move COPY commands after package installations for better caching
- Move app source copy in debug stage after apt package installations - Move app source copy in tests stage after Playwright installation - Improves Docker layer caching by preventing app changes from invalidating package installation layers Co-authored-by: dannystaple <426859+dannystaple@users.noreply.github.com>
1 parent d90dc85 commit b92effa

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ RUN npm ci
99

1010
FROM base AS debug
1111

12-
# Copy app source for development
13-
COPY . /app/src
14-
1512
RUN apt-get update && apt-get install -y \
1613
less \
1714
iputils-ping \
1815
dnsutils
1916

17+
# Copy app source for development
18+
COPY . /app/src
19+
2020
FROM dcycle/broken-link-checker:3 AS broken_link_checker
2121

2222
FROM httpd:2.4.64 AS httpd_serve
@@ -47,9 +47,6 @@ COPY . /usr/local/apache2/htdocs/
4747

4848
FROM base AS tests
4949

50-
# Copy app source for testing
51-
COPY . /app/src
52-
5350
# Install necessary packages for Playwright
5451
RUN apt-get update && apt-get install -y \
5552
libnss3 \
@@ -64,6 +61,9 @@ RUN apt-get update && apt-get install -y \
6461
# Install Playwright browsers
6562
RUN npx playwright install chromium --with-deps
6663

64+
# Copy app source for testing
65+
COPY . /app/src
66+
6767
# Set default command to run BDD tests
6868
CMD ["npm", "run", "test:bdd"]
6969

0 commit comments

Comments
 (0)