24 lines
498 B
Docker
24 lines
498 B
Docker
FROM node:lts-alpine AS base
|
|
|
|
WORKDIR /app
|
|
|
|
COPY package.json .
|
|
COPY yarn.lock .
|
|
COPY . .
|
|
|
|
RUN yarn install && \
|
|
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;"]
|
|
|