Skip to content

Commit 7dfc123

Browse files
chore(docker): avoid copying package-lock.json and install dependencies
1 parent 7f85096 commit 7dfc123

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

Dockerfile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ WORKDIR /app
55
ENV PATH /app/node_modules/.bin:$PATH
66

77
COPY package.json ./
8-
COPY package-lock.json ./
9-
RUN npm install --silent
10-
RUN npm install react-scripts@latest -g --silent
8+
RUN npm i --silent
9+
RUN npm i react-scripts@latest -g --silent
1110

1211
COPY . ./

Dockerfile.dev

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# build environment
2-
FROM node:22-alpine3.18 as build
2+
FROM node:22-alpine as build
33
WORKDIR /app
44
ENV PATH /app/node_modules/.bin:$PATH
55
COPY package.json ./
6-
COPY package-lock.json ./
76
RUN export NODE_OPTIONS=--max-old-space-size=8192
8-
RUN npm ci --silent
9-
RUN npm install react-scripts@latest -g --silent
7+
RUN npm i --silent
8+
9+
RUN npm i react-scripts@latest -g --silent
1010
COPY . ./
1111
RUN npm run build
1212

Dockerfile.prod

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@ FROM node:22-alpine3.18 as build
77
WORKDIR /app
88
ENV PATH /app/node_modules/.bin:$PATH
99
COPY package.json ./
10-
COPY package-lock.json ./
1110
RUN export NODE_OPTIONS=--max-old-space-size=8192
12-
RUN npm ci --silent
13-
RUN npm install react-scripts@latest -g --silent
11+
RUN npm i --silent
12+
RUN npm i react-scripts@latest -g --silent
1413
COPY . ./
1514
RUN echo "export default { version: '$RELEASE_VERSION' };" > src/versionInfo.ts
1615
RUN npm run build -- --outDir=build

0 commit comments

Comments
 (0)