Skip to content

Instantly share code, notes, and snippets.

@bharatc9530
Created January 26, 2022 15:29
Show Gist options
  • Save bharatc9530/a73385c20c22f22cf12d2ba092a5fdac to your computer and use it in GitHub Desktop.
Save bharatc9530/a73385c20c22f22cf12d2ba092a5fdac to your computer and use it in GitHub Desktop.
FROM node:13-alpine
ENV MONGO_DB_USERNAME=admin \
MONGO_DB_PWD=password
RUN mkdir -p /home/app
COPY ./app /home/app
# set default dir so that next commands executes in /home/app dir
WORKDIR /home/app
# will execute npm install in /home/app because of WORKDIR
RUN npm install
# no need for /home/app/server.js because of WORKDIR
CMD ["node", "server.js"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment