Skip to content

Commit 1d60bea

Browse files
committed
Optimizes Docker caching and updates dependencies
Refines Docker build process to leverage layer caching and switches to a clean install routine for consistent dependencies and faster builds
1 parent 3319a5e commit 1d60bea

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

editor/Dockerfile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
FROM node:18-alpine AS build
33
WORKDIR /app
44

5-
# Copy package files
6-
COPY package*.json ./
7-
RUN npm install
5+
# Copy package files first for better Docker layer caching
6+
COPY package.json package-lock.json ./
7+
8+
# Install dependencies (including dev dependencies needed for build)
9+
RUN npm ci
810

911
# Copy source code
1012
COPY . .
@@ -16,7 +18,7 @@ RUN npm run build
1618
FROM nginx:alpine
1719
COPY --from=build /app/dist /usr/share/nginx/html
1820

19-
# Copy custom nginx config if needed
21+
# Copy custom nginx config
2022
COPY nginx.conf /etc/nginx/nginx.conf
2123

2224
# Expose port 80

0 commit comments

Comments
 (0)