FROM node:20-alpine3.18
# ...
RUN apk add --no-cache python3 make g++
# ...
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod
CMD ["sh", "-c", "node --enable-source-maps --require dotenv/config --require ./appsignal.cjs ./dist/index.js"]
Docker logs:
Error: Cannot find module '../build/Release/extension.node'
Require stack:
- /app/node_modules/.pnpm/@appsignal+nodejs@3.4.5/node_modules/@appsignal/nodejs/dist/extension_wrapper.js
- /app/node_modules/.pnpm/@appsignal+nodejs@3.4.5/node_modules/@appsignal/nodejs/dist/extension.js
- /app/node_modules/.pnpm/@appsignal+nodejs@3.4.5/node_modules/@appsignal/nodejs/dist/client.js
- /app/node_modules/.pnpm/@appsignal+nodejs@3.4.5/node_modules/@appsignal/nodejs/dist/index.js
- /app/appsignal.cjs
- internal/preload
at Module._resolveFilename (node:internal/modules/cjs/loader:1145:15)
at Module._load (node:internal/modules/cjs/loader:986:27)
at Module.require (node:internal/modules/cjs/loader:1233:19)
at require (node:internal/modules/helpers:179:18)
at Object.<anonymous> (/app/node_modules/.pnpm/@appsignal+nodejs@3.4.5/node_modules/@appsignal/nodejs/dist/extension_wrapper.js:18:11)
at Module._compile (node:internal/modules/cjs/loader:1358:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
at Module.load (node:internal/modules/cjs/loader:1208:32)
at Module._load (node:internal/modules/cjs/loader:1024:12)
at Module.require (node:internal/modules/cjs/loader:1233:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/app/node_modules/.pnpm/@appsignal+nodejs@3.4.5/node_modules/@appsignal/nodejs/dist/extension_wrapper.js',
'/app/node_modules/.pnpm/@appsignal+nodejs@3.4.5/node_modules/@appsignal/nodejs/dist/extension.js',
'/app/node_modules/.pnpm/@appsignal+nodejs@3.4.5/node_modules/@appsignal/nodejs/dist/client.js',
'/app/node_modules/.pnpm/@appsignal+nodejs@3.4.5/node_modules/@appsignal/nodejs/dist/index.js',
'/app/appsignal.cjs',
'internal/preload'
]
}
AppSignal not starting: extension failed to load
{"level":30,"time":1718301526412,"pid":1,"hostname":"af423e5bd35d","msg":"Server listening at http://0.0.0.0:3000"}
{"level":30,"time":1718301526412,"pid":1,"hostname":"af423e5bd35d","msg":"Application started in production mode and available at port 3000"}
I tried to use the node:20-alpine3.19 too but that didn't work too.
Dockerfile:
Docker logs:
I tried to use the
node:20-alpine3.19
too but that didn't work too.