This repository has been archived on 2025-06-11. You can view files and clone it, but cannot push or open issues or pull requests.
Files
demystifying-docker-previous/dockerfile-examples/react/react-app/Dockerfile.correct
2025-05-03 21:16:41 -04:00

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;"]