22 lines
402 B
Docker
22 lines
402 B
Docker
FROM node:lts AS dev
|
|
ENV NODE_ENV development
|
|
# some dir for our code
|
|
WORKDIR /app
|
|
# mount code
|
|
VOLUME ["/app"]
|
|
# this is how we start
|
|
CMD [ "yarn", "dev" ]
|
|
|
|
|
|
FROM node:lts AS prod
|
|
ENV NODE_ENV production
|
|
# some dir for our code
|
|
WORKDIR /app
|
|
# install dependencies
|
|
COPY package*.json yarn*.lock ./
|
|
RUN yarn --production
|
|
# copy code
|
|
COPY . .
|
|
USER node
|
|
# this is how we start
|
|
CMD [ "yarn", "start" ]
|