# use the latest node LTS release
FROM node:slim
WORKDIR /home/node/app

ARG NODE_ENV
ENV NODE_ENV $NODE_ENV

# copy package.json and package-lock.json and install packages. we do this
# separate from the application code to better use docker's caching
# `npm install` will be cached on future builds if only the app code changed
COPY package.json /home/node/app/
RUN npm install

# copy the app
COPY . /home/node/app

# expose port 3000 and start the app
EXPOSE 3000

#ENTRYPOINT ["node","/home/node/app/app.js"] # exec form 

CMD [ "npm", "start" ]