File tree 1 file changed +14
-9
lines changed 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
+ # ###########################################################
3
4
FROM node:lts-alpine AS base
4
5
5
6
RUN apk update; \
6
7
apk add git;
7
-
8
8
WORKDIR /src
9
9
10
10
# Copy package.json first to benefit from layer caching
11
11
COPY 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
+
13
16
# Copy production node_modules aside for later
14
17
RUN cp -R node_modules prod_node_modules
15
- # Install remaining dev dependencies
16
- RUN npm install
17
18
19
+ # Copy src to have webpack config files ready for install
18
20
COPY . /src
19
21
22
+ # Install remaining dev dependencies
23
+ RUN npm ci
24
+
20
25
# Run all webpack build steps
21
26
RUN npm run prepare && npm run build
22
27
23
-
24
- #
25
- # --- Production Image ---
28
+ # ###########################################################
29
+ # Release stage
30
+ # ###########################################################
26
31
FROM node:lts-alpine AS release
27
32
WORKDIR /src
28
33
You can’t perform that action at this time.
0 commit comments