22 lines
409 B
Docker
22 lines
409 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-alpine 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" ]
|