23 lines
426 B
Docker

FROM node:12.4.0-alpine as dev
RUN mkdir /work/
WORKDIR /work/
COPY ./src/package.json /work/package.json
RUN npm install
RUN npm install -g nodemon
COPY ./src/ /work/src/
# CMD [ "nodemon", "--inspect=0.0.0.0:9229", "./src/server.js" ]
###########START NEW IMAGE###################
FROM node:12.4.0-alpine as prod
WORKDIR /work/
COPY ./src/package.json /work/package.json
RUN npm install
COPY ./src/ /work/
CMD node .