20 lines
403 B
Docker
20 lines
403 B
Docker
FROM node:lts AS dev
|
|
# some dir for our code
|
|
WORKDIR /app
|
|
# mount code
|
|
VOLUME ["/app"]
|
|
# this is how we start
|
|
CMD [ "yarn", "start" ]
|
|
|
|
FROM node:lts AS build
|
|
# some dir for our code
|
|
WORKDIR /app
|
|
# install dependencies
|
|
COPY package*.json yarn*.lock ./
|
|
RUN yarn --production=false
|
|
# copy code
|
|
COPY . .
|
|
RUN yarn build
|
|
|
|
FROM nginx:stable-alpine AS prod
|
|
COPY --from=build /app/dist /usr/share/nginx/html
|