File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11FROM node:24-alpine
22
33WORKDIR /usr/src/app
4- COPY . .
4+
5+ # Copy only the dependency manifests first so the npm ci layers
6+ # stay cached as long as the lockfiles don't change
7+ COPY package.json package-lock.json ./
8+ COPY frontend/package.json frontend/package-lock.json ./frontend/
9+
510# install backend libs
6- RUN npm cache clean --force && npm ci
11+ RUN npm ci
712# install frontend libs
8- RUN cd frontend && npm cache clean --force && npm ci
13+ RUN cd frontend && npm ci
14+
15+ # Copy in the source - code changes only invalidate layers from here down
16+ COPY . .
17+
918# build backend
1019RUN npm run build
1120# build frontend
@@ -14,4 +23,4 @@ RUN cd frontend && npm run build
1423RUN rm -rf frontend/node_modules
1524
1625EXPOSE 8080
17- CMD [ "node" , "--enable-source-maps" , "dist/src/index.js" ]
26+ CMD [ "node" , "--enable-source-maps" , "dist/src/index.js" ]
You can’t perform that action at this time.
0 commit comments