Skip to content

Commit 3c8b67e

Browse files
authored
refactor: Remove warnings in Docker build (#2350)
1 parent a843ff5 commit 3c8b67e

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

Dockerfile

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
############################################################
22
# Build stage
33
############################################################
4-
FROM node:lts-alpine AS base
4+
FROM node:lts-alpine AS build
55

6-
RUN apk update; \
7-
apk add git;
6+
RUN apk --no-cache add git
87
WORKDIR /src
98

109
# Copy package.json first to benefit from layer caching
1110
COPY package*.json ./
1211

1312
# Install without scripts otherwise webpack will fail
14-
RUN npm ci --production --ignore-scripts
13+
RUN npm ci --omit=dev --ignore-scripts
1514

1615
# Copy production node_modules aside for later
1716
RUN cp -R node_modules prod_node_modules
@@ -32,11 +31,11 @@ FROM node:lts-alpine AS release
3231
WORKDIR /src
3332

3433
# Copy production node_modules
35-
COPY --from=base /src/prod_node_modules /src/node_modules
36-
COPY --from=base /src/package*.json /src/
34+
COPY --from=build /src/prod_node_modules /src/node_modules
35+
COPY --from=build /src/package*.json /src/
3736

3837
# Copy compiled src dirs
39-
COPY --from=base /src/Parse-Dashboard/ /src/Parse-Dashboard/
38+
COPY --from=build /src/Parse-Dashboard/ /src/Parse-Dashboard/
4039

4140
USER node
4241

0 commit comments

Comments
 (0)