timemanager/frontend/Dockerfile
Nils Beyer 7f6b4c2e08
All checks were successful
Java CI with Maven / build (push) Successful in 48s
Implement redirect for /api in docker deployment
2023-11-13 10:46:45 +01:00

24 lines
532 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.template /etc/nginx/nginx.conf.template
COPY docker-entrypoint.sh /app-entrypoint.sh
RUN chmod +x /app-entrypoint.sh
ENTRYPOINT [ "/app-entrypoint.sh" ]
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]