Assuming this is a production Dockerfile
, the boilerplate configuration for a Nodejs type of application would look like this:
FROM node:alpine as builder
WORKDIR '/app'
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
or like this:
FROM node:alpine
WORKDIR "/app"
COPY ./package.json ./
RUN npm install
COPY . .
CMD ["npm", "run", "start"]
and if you involve Nginx, you may additionally have a couple of lines that would look something like this:
FROM nginx
EXPOSE 80
COPY --from=builder /app/build /usr/share/nginx/html
So now you have a couple of answers with a few variations of how you could write out the production ready Dockerfile
.