Last active
February 16, 2021 05:30
-
-
Save mosesliao/085e08caa15d6d9ed8df8e0086948bc9 to your computer and use it in GitHub Desktop.
the nodejs Dockerfiles before attempts to reduce size
This file contains hidden or 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:8.12 | |
# version of app | |
LABEL version="1.1" | |
RUN apt-get update | |
RUN apt-get install -y git | |
WORKDIR /home/node/app | |
COPY . /home/node/app | |
RUN mkdir /root/.ssh/ | |
COPY id_rsa /root/.ssh/id_rsa | |
RUN chmod 600 /root/.ssh/id_rsa | |
RUN npm install | |
RUN apt-get remove -y git | |
# Remove SSH keys | |
RUN rm -rf /root/.ssh/ | |
USER "node" | |
# use node has user | |
EXPOSE 3030 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment