2020-09-24 16:20:33 +02:00
|
|
|
# stage1 as builder
|
2024-02-22 08:30:30 +01:00
|
|
|
FROM node:20-alpine AS builder
|
2020-09-24 16:20:33 +02:00
|
|
|
|
|
|
|
# copy the package.json to install dependencies
|
|
|
|
COPY package.json ./
|
|
|
|
|
|
|
|
# Install the dependencies and make the folder
|
|
|
|
RUN npm install && mkdir /src && mv ./node_modules ./src
|
|
|
|
|
|
|
|
WORKDIR /src
|
|
|
|
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
# Build the project and copy the files
|
2021-01-22 09:32:07 +01:00
|
|
|
RUN npm run ng build -- --prod
|
|
|
|
#RUN node --max_old_space_size=8192 node_modules/@angular/cli/bin/ng build -- --deploy-url=/ --prod
|
2020-09-24 16:20:33 +02:00
|
|
|
|
|
|
|
FROM nginx:alpine
|
|
|
|
|
|
|
|
#!/bin/sh
|
|
|
|
|
2020-12-16 13:19:58 +01:00
|
|
|
COPY nginx.conf.CI /etc/nginx/conf.d/default.conf
|
2021-01-22 09:32:07 +01:00
|
|
|
COPY start_nginx.sh /start_nginx.sh
|
|
|
|
RUN mkdir -p /tmp/log/nginx
|
|
|
|
|
2020-09-24 16:20:33 +02:00
|
|
|
|
|
|
|
## Remove default nginx index page
|
|
|
|
RUN rm -rf /usr/share/nginx/html/*
|
|
|
|
|
2021-01-22 09:32:07 +01:00
|
|
|
# Copy from the stage 1
|
2020-09-24 16:20:33 +02:00
|
|
|
COPY --from=builder /src/dist /usr/share/nginx/html
|
2021-01-22 09:32:07 +01:00
|
|
|
RUN cp /usr/share/nginx/html/index.html /usr/share/nginx/html/index_base.html
|
2020-09-24 16:20:33 +02:00
|
|
|
|
|
|
|
EXPOSE 8080
|
2021-01-22 09:32:07 +01:00
|
|
|
ENTRYPOINT ["sh", "/start_nginx.sh"]
|