Newer
Older
# Stage 0, based on Node.js, to build and compile Angular
FROM node:12.16-slim as builder
WORKDIR /app
# Copy the package.json file first in order to cache the modules
COPY ./package.json .
COPY ./package-lock.json .
# Install npm dependencies
COPY angular.json .
COPY tsconfig.json .
COPY nginx.conf .
COPY /src ./src
ARG conf
# Building the Angular app /dist i18n
# Stage 1, based on Nginx, to have only the compiled app
# copy artifact build from the 'build environment'
COPY --from=build /app/dist /var/www/htdocs
COPY --from=build /app/nginx.conf /etc/nginx/nginx.conf
# expose port 8080
EXPOSE 8080
# run nginx
CMD ["nginx", "-g", "daemon off;"]