File tree Expand file tree Collapse file tree 1 file changed +14
-9
lines changed Expand file tree Collapse file tree 1 file changed +14
-9
lines changed Original file line number Diff line number Diff line change 1- #
2- # --- Base Node Image ---
1+ # ###########################################################
2+ # Build stage
3+ # ###########################################################
34FROM node:lts-alpine AS base
45
56RUN apk update; \
67 apk add git;
7-
88WORKDIR /src
99
1010# Copy package.json first to benefit from layer caching
1111COPY package*.json ./
12- RUN npm install --only=production
12+
13+ # Install without scripts otherwise webpack will fail
14+ RUN npm ci --production --ignore-scripts
15+
1316# Copy production node_modules aside for later
1417RUN cp -R node_modules prod_node_modules
15- # Install remaining dev dependencies
16- RUN npm install
1718
19+ # Copy src to have webpack config files ready for install
1820COPY . /src
1921
22+ # Install remaining dev dependencies
23+ RUN npm ci
24+
2025# Run all webpack build steps
2126RUN npm run prepare && npm run build
2227
23-
24- #
25- # --- Production Image ---
28+ # ###########################################################
29+ # Release stage
30+ # ###########################################################
2631FROM node:lts-alpine AS release
2732WORKDIR /src
2833
You can’t perform that action at this time.
0 commit comments