Skip to content

Commit e1f8de8

Browse files
authored
ci: fix docker build with node:lts-alpine (#7663)
1 parent f1238ea commit e1f8de8

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

Dockerfile

+14-3
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,30 @@
1+
############################################################
12
# Build stage
3+
############################################################
24
FROM node:lts-alpine as build
35

46
RUN apk update; \
57
apk add git;
68
WORKDIR /tmp
9+
10+
# Copy package.json first to benefit from layer caching
711
COPY package*.json ./
812

9-
# Copy local dependencies for CI tests
10-
COPY spec/dependencies spec/dependencies
13+
# Copy src to have config files for install
14+
COPY . .
1115

16+
# Clean npm cache; added to fix an issue with the install process
1217
RUN npm cache clean --force
18+
19+
# Install all dependencies
1320
RUN npm ci
14-
COPY . .
21+
22+
# Run build steps
1523
RUN npm run build
1624

25+
############################################################
1726
# Release stage
27+
############################################################
1828
FROM node:lts-alpine as release
1929

2030
RUN apk update; \
@@ -26,6 +36,7 @@ WORKDIR /parse-server
2636

2737
COPY package*.json ./
2838

39+
# Clean npm cache; added to fix an issue with the install process
2940
RUN npm cache clean --force
3041
RUN npm ci --production --ignore-scripts
3142

0 commit comments

Comments
 (0)