timemanager/frontend/Dockerfile

24 lines
532 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.template /etc/nginx/nginx.conf.template
COPY docker-entrypoint.sh /app-entrypoint.sh
RUN chmod +x /app-entrypoint.sh
ENTRYPOINT [ "/app-entrypoint.sh" ]
2023-09-25 11:01:28 +02:00
EXPOSE 80
2023-11-12 16:43:39 +01:00
CMD ["nginx", "-g", "daemon off;"]