Docker | Simple NodeJS Dockerfile
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
# We use the latest nodejs@14 image as our base image | |
FROM node:14-alpine | |
# set the default NODE_NEV to production | |
ENV NODE ENV=production | |
# make sure everything happens inside the /app folder | |
WORKDIR/app | |
# now we cache the node_modules layer | |
COPY ["package.json", "package-lock.json", "./"] | |
# install your dependencies | |
RUN npm install | |
# copy the source | |
COPY /src . | |
# and start the app | |
CMD ["node", "server. js"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment