Skip to content

Commit 12c3c8f

Browse files
docker image time optimization v1
1 parent 0b561fa commit 12c3c8f

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

src/App/Dockerfile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,13 @@ WORKDIR /app/frontend
88
# Copy package files first for better caching
99
COPY package*.json ./
1010

11-
# Install dependencies
12-
RUN npm ci --silent
11+
# Install dependencies once (cached unless package*.json changes)
12+
# npm rebuild esbuild --force ensures the correct platform binary inside the Linux image
13+
RUN npm ci && npm rebuild esbuild --force
1314

14-
# Copy source files
15+
# Copy source files (node_modules excluded by .dockerignore)
1516
COPY . ./
1617

17-
RUN rm -rf node_modules && npm ci && npm rebuild esbuild --force
18-
1918
# Build the React app
2019
RUN npm run build
2120

0 commit comments

Comments
 (0)