Skip to content

Instantly share code, notes, and snippets.

@mosesliao
Last active February 16, 2021 05:30
Show Gist options
  • Save mosesliao/085e08caa15d6d9ed8df8e0086948bc9 to your computer and use it in GitHub Desktop.
Save mosesliao/085e08caa15d6d9ed8df8e0086948bc9 to your computer and use it in GitHub Desktop.
the nodejs Dockerfiles before attempts to reduce size
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