|
|
|
|
|
|
|
|
|
|
|
|
|
|
FROM node:16 AS builder |
|
|
FROM node:16 AS builder |
|
|
|
|
|
|
|
|
WORKDIR /app |
|
|
WORKDIR /app |
|
|
# Copy all files from current directory to working dir in image |
|
|
# Copy all files from current directory to working dir in image |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
COPY package*.json /app/ |
|
|
COPY package*.json /app/ |
|
|
RUN npm install |
|
|
RUN npm install |
|
|
COPY ./ /app/ |
|
|
COPY ./ /app/ |
|
|
|
|
|
|
|
|
WORKDIR /usr/share/nginx/html |
|
|
WORKDIR /usr/share/nginx/html |
|
|
RUN rm -rf ./* |
|
|
RUN rm -rf ./* |
|
|
COPY --from=builder /app/build . |
|
|
COPY --from=builder /app/build . |
|
|
|
|
|
COPY nginx.conf /etc/nginx/conf.d/default.conf |
|
|
# Containers run nginx with global directives and daemon off |
|
|
# Containers run nginx with global directives and daemon off |
|
|
ENTRYPOINT ["nginx", "-g", "daemon off;"] |
|
|
ENTRYPOINT ["nginx", "-g", "daemon off;"] |