diff --git a/docker/red-ui/Dockerfile b/docker/red-ui/Dockerfile index b35057ee3..d97e19fe5 100644 --- a/docker/red-ui/Dockerfile +++ b/docker/red-ui/Dockerfile @@ -1,6 +1,5 @@ -FROM node:14.17-alpine as prep -RUN apk add --update jq && rm -rf /var/cache/apk/* - +FROM node:14.18-buster as prep +RUN apt-get update && apt-get install -y jq COPY package.json /tmp RUN jq '{ dependencies, devDependencies, peerDependencies, scripts: (.scripts | { postinstall }) }' < /tmp/package.json > /tmp/deps.json @@ -9,13 +8,16 @@ RUN jq '{ dependencies, devDependencies, peerDependencies, scripts: (.scripts | ### STAGE 1: Build ### # We label our stage as ‘builder’ -FROM node:14.17-alpine as builder +FROM node:14.18-buster as builder + COPY --from=prep /tmp/deps.json ./package.json COPY yarn.lock ./ ## Storing node modules on a separate layer will prevent unnecessary npm installs at each build RUN yarn install && mkdir /ng-app && mv ./node_modules ./ng-app + + WORKDIR /ng-app COPY apps apps @@ -32,15 +34,16 @@ COPY paligo-styles paligo-styles COPY sonar.js sonar.js ## Build the angular app in production mode and store the artifacts in dist folder +RUN node sonar.js RUN yarn run build-lint-all RUN yarn run build-paligo-styles -RUN node sonar.js + CMD ["/bin/cp", "-r", "/ng-app/dist/paligo-styles", "/tmp/styles-export"] ### STAGE 2: Setup ### -FROM nginx:1.19.2-alpine +FROM nginx:1.21.4-alpine RUN apk add --update nano && rm -rf /var/cache/apk/* ## Copy our default nginx config