25 lines
491 B
Docker
25 lines
491 B
Docker
FROM node:lts-alpine AS base
|
|
|
|
WORKDIR /app
|
|
|
|
COPY package.json yarn.lock ./
|
|
|
|
RUN yarn install
|
|
|
|
COPY . .
|
|
|
|
RUN yarn build
|
|
|
|
FROM nginx:alpine AS serve
|
|
WORKDIR /usr/share/nginx/html
|
|
COPY --from=base /app/dist .
|
|
|
|
EXPOSE 80
|
|
|
|
# Demonstrate the difference between CMD and Entrypoint
|
|
# Running image with cmd defined will override the command the container runs
|
|
# Whereas entrypoint, any command you add will be appended
|
|
CMD ["nginx", "-g", "daemon off;"]
|
|
# ENTRYPOINT ["nginx", "-g", "daemon off;"]
|
|
|