19 lines
399 B
Docker
19 lines
399 B
Docker
### STAGE 1: Build ###
|
|
FROM node:18.17.1 AS build
|
|
WORKDIR /app
|
|
COPY package*.json ./
|
|
RUN npm install
|
|
COPY . .
|
|
RUN npm run build --prod
|
|
|
|
### STAGE 2: Deploy ###
|
|
FROM nginx:latest
|
|
RUN apt-get update
|
|
RUN apt-get upgrade -y
|
|
RUN apt-get install iputils-ping -y
|
|
COPY --from=build /app/dist/frontend /usr/share/nginx/html
|
|
COPY nginx.conf /etc/nginx/nginx.conf
|
|
|
|
EXPOSE 80
|
|
CMD ["nginx", "-g", "daemon off;"]
|