Last active
June 23, 2022 06:42
-
-
Save takuto-h/c98543ad84c6ffdc5cfec42e5ebe3b91 to your computer and use it in GitHub Desktop.
Use node-gyp with node:*-slim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM node:10.15.1-slim | |
COPY ./package.json ./yarn.lock /app/ | |
# Install dependencies for node-gyp | |
# https://github.com/nodejs/node-gyp#on-unix | |
RUN buildDeps='g++ make python' \ | |
&& apt-get update \ | |
&& apt-get install -y --no-install-recommends $buildDeps \ | |
&& cd /app \ | |
&& yarn install --frozen-lockfile \ | |
&& yarn cache clean \ | |
&& apt-get remove -y --purge --auto-remove $buildDeps \ | |
&& rm -rf /var/lib/apt/lists/* /tmp/* /root/.node-gyp /usr/local/lib/node_modules/npm/node_modules/node-gyp | |
COPY ./test.mjs /app/ | |
ENTRYPOINT ["node", "--experimental-modules", "--no-warnings", "/app/test.mjs"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment