Skip to content

Commit a825565

Browse files
authored
Merge pull request #246 from orionrobots/copilot/fix-245
Optimize Docker stage caching by moving app copy after package installations
2 parents 466ed1a + b92effa commit a825565

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

Dockerfile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,16 @@ WORKDIR /app/src
77
COPY package.json package-lock.json ./
88
RUN npm ci
99

10-
# Copy rest of the app source
11-
COPY . /app/src
12-
1310
FROM base AS debug
1411

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
@@ -61,7 +61,13 @@ RUN apt-get update && apt-get install -y \
6161
# Install Playwright browsers
6262
RUN npx playwright install chromium --with-deps
6363

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

6770
FROM base
71+
72+
# Copy app source for the final stage
73+
COPY . /app/src

0 commit comments

Comments
 (0)