Skip to content

Commit df89cbf

Browse files
authored
ci: fix docker CI with lts-alpine (#1899)
1 parent 1aaeedf commit df89cbf

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

Dockerfile

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,34 @@
1-
#
2-
# --- Base Node Image ---
3-
FROM node:14-alpine AS base
1+
############################################################
2+
# Build stage
3+
############################################################
4+
FROM node:lts-alpine AS base
45

56
RUN apk update; \
67
apk add git;
7-
88
WORKDIR /src
99

1010
# Copy package.json first to benefit from layer caching
1111
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+
1316
# Copy production node_modules aside for later
1417
RUN 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
1820
COPY . /src
1921

22+
# Install remaining dev dependencies
23+
RUN npm ci
24+
2025
# Run all webpack build steps
2126
RUN npm run prepare && npm run build
2227

23-
24-
#
25-
# --- Production Image ---
26-
FROM node:14-alpine AS release
28+
############################################################
29+
# Release stage
30+
############################################################
31+
FROM node:lts-alpine AS release
2732
WORKDIR /src
2833

2934
# Copy production node_modules

0 commit comments

Comments
 (0)