timemanager/frontend/Dockerfile

19 lines
399 B
Docker
Raw Normal View History

2023-11-12 16:43:39 +01:00
### STAGE 1: Build ###
FROM node:18.17.1 AS build
WORKDIR /app
2023-09-25 11:01:28 +02:00
COPY package*.json ./
2023-11-12 16:43:39 +01:00
RUN npm install
2023-09-25 11:01:28 +02:00
COPY . .
2023-11-12 16:43:39 +01:00
RUN npm run build --prod
2023-09-25 11:01:28 +02:00
2023-11-12 16:43:39 +01:00
### 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
2023-09-25 11:01:28 +02:00
EXPOSE 80
2023-11-12 16:43:39 +01:00
CMD ["nginx", "-g", "daemon off;"]