Skip to content
This repository was archived by the owner on Jan 23, 2024. It is now read-only.

Commit 1bc4005

Browse files
authored
fix: use npm v8 in expressapp container to workaround slow npm install from github (#1484)
The switch to node v16 gets use npm v8, to workaround an issue with slow 'npm install <any github repo dependency>'. See: npm/cli#4896 In our case the github repo dependency was the command given to docker run this container: bash -c "npm install elastic-apm-node#SOME-COMMIT-SHA && node app.js" This also adds a package.json to more explicitly declare we are working with a node project workspace. Also avoid generating a package-lock file we won't use. Fixes: #1483
1 parent 601c06a commit 1bc4005

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

docker/nodejs/express/.npmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package-lock=false

docker/nodejs/express/Dockerfile

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
FROM node:12.18.1
1+
FROM node:16.15.0
22

33
RUN mkdir -p /app
4-
RUN npm install express
5-
6-
COPY app.js /app
4+
COPY package.json .npmrc app.js /app/
75

86
WORKDIR /app
7+
RUN npm install
8+

docker/nodejs/express/package.json

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "expressapp",
3+
"version": "1.0.0",
4+
"private": true,
5+
"main": "app.js",
6+
"dependencies": {
7+
"express": "*"
8+
}
9+
}

0 commit comments

Comments
 (0)