Skip to content

Commit 2ff4b20

Browse files
authored
Ensure Dockerfile has Linux-only npm packages in lock file. (#69)
The package-lock.json file committed to the repository may lack Linux-only packages that wouldn't be installed by `npm install` on (say) macOS. This currently blocks `docker build .` from succeeding. The only robust solution to this is to allow lock file updatings during the Docker build. Signed-off-by: Jacob Howard <[email protected]>
1 parent efa0035 commit 2ff4b20

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ COPY package.json .
2020
COPY package-lock.json .
2121
COPY tsconfig.json .
2222

23-
RUN npm ci
23+
# Refresh the lock file to be sure we include Linux-only packages that might not
24+
# be in the existing package-lock.json.
25+
RUN npm install --package-lock-only \
26+
&& npm ci
2427

2528
COPY src/ ./src/
2629

@@ -50,4 +53,4 @@ USER appuser
5053
ENV NODE_ENV=production
5154

5255
# Command to run the application
53-
ENTRYPOINT ["node", "dist/index.js"]
56+
ENTRYPOINT ["node", "dist/index.js"]

0 commit comments

Comments
 (0)