Skip to content

Commit 671c28e

Browse files
committed
ci: fix docker CI with lts-alpine (#1899)
1 parent cdef22a commit 671c28e

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

Dockerfile

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,33 @@
1-
#
2-
# --- Base Node Image ---
1+
############################################################
2+
# Build stage
3+
############################################################
34
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 ---
28+
############################################################
29+
# Release stage
30+
############################################################
2631
FROM node:lts-alpine AS release
2732
WORKDIR /src
2833

0 commit comments

Comments
 (0)