-
I use FROM seepine/alpine:node-3.19 # just install node from alpine
WORKDIR /workspace
COPY ./dist /workspace
COPY ./node_modules /workspace/node_modules
ENTRYPOINT crond && node app.js But i got error
I know it maybe need How to correctly use |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Run |
Beta Was this translation helpful? Give feedback.
-
@seepine if you want to keep your docker image small, use a multi-stage build: https://docs.docker.com/build/building/multi-stage/ The first stage should install python and a compiler tool chain, and then run The second stage starts with the original small alpine image, and just copies over the compiled files. If this is too in-the-weeds for you, I suspect using Alpine (with non-glibc, MUSL binaries) will be a lot more hassle than just this issue. I'd try to get running with a Debian slim image instead (the image will be slightly larger, but everything should “just work” out of the box). |
Beta Was this translation helpful? Give feedback.
@seepine if you want to keep your docker image small, use a multi-stage build: https://docs.docker.com/build/building/multi-stage/
The first stage should install python and a compiler tool chain, and then run
npm install
.The second stage starts with the original small alpine image, and just copies over the compiled files.
If this is too in-the-weeds for you, I suspect using Alpine (with non-glibc, MUSL binaries) will be a lot more hassle than just this issue. I'd try to get running with a Debian slim image instead (the image will be slightly larger, but everything should “just work” out of the box).