Skip to content

Commit 65fe9a4

Browse files
authoredNov 17, 2023
fix(docker): skip install when node_modules is present (#3429)
1 parent c4f4ee6 commit 65fe9a4

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed
 

‎.dockerignore

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ docs
1010
.coverage
1111
pkg
1212
test
13-
node_modules
1413
kubernetes
1514
wallaby.js
1615
docker

‎docker/Dockerfile

+4-1
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,11 @@ COPY package.json yarn.lock .yarnrc.yml ./
1616
COPY .yarn/releases .yarn/releases
1717

1818
ENV YARN_HTTP_TIMEOUT=300000
19+
# set production env install will not install devDependencies
20+
ENV NODE_ENV=production
1921

20-
RUN yarn install --immutable
22+
# if node_modules does not exist, run it, otherwise skip
23+
RUN test -d node_modules || yarn install --immutable
2124

2225
# Fix issue with serialport bindings #2349
2326
RUN npm_config_build_from_source=true yarn rebuild @serialport/bindings-cpp

0 commit comments

Comments
 (0)