Skip to content

Commit

Permalink
HAAR-1031 Update dependencies (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
karenmillermoj committed Dec 2, 2022
1 parent 5c48031 commit ff75d73
Show file tree
Hide file tree
Showing 5 changed files with 4,789 additions and 5,600 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2.1

orbs:
hmpps: ministryofjustice/hmpps@6.0
hmpps: ministryofjustice/hmpps@6.2
slack: circleci/slack@4.8.3

parameters:
Expand All @@ -14,7 +14,7 @@ parameters:

node-version:
type: string
default: 16.17-browsers
default: 18.12-browsers

jobs:
build:
Expand Down
34 changes: 18 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,49 +1,51 @@
# Stage: base image
ARG BUILD_NUMBER
ARG GIT_REF
FROM node:18.12-bullseye-slim as base

FROM node:16.14-bullseye-slim as base
ARG BUILD_NUMBER=1_0_0
ARG GIT_REF=not-available

LABEL maintainer="HMPPS Digital Studio <info@digital.justice.gov.uk>"

ENV TZ=Europe/London
RUN ln -snf "/usr/share/zoneinfo/$TZ" /etc/localtime && echo "$TZ" > /etc/timezone

RUN addgroup --gid 2000 --system appgroup && \
adduser --uid 2000 --system appuser --gid 2000
adduser --uid 2000 --system appuser --gid 2000

WORKDIR /app

# Cache breaking
ENV BUILD_NUMBER ${BUILD_NUMBER:-1_0_0}

RUN apt-get update && \
apt-get upgrade -y
apt-get upgrade -y && \
apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/*

# Stage: build assets
FROM base as build
ARG BUILD_NUMBER
ARG GIT_REF

RUN apt-get install -y make python g++
ARG BUILD_NUMBER=1_0_0
ARG GIT_REF=not-available

RUN apt-get update && \
apt-get install -y make python g++

COPY package*.json ./
RUN CYPRESS_INSTALL_BINARY=0 npm ci --no-audit

COPY . .
RUN npm run build

ENV BUILD_NUMBER ${BUILD_NUMBER:-1_0_0}
ENV GIT_REF ${GIT_REF:-dummy}
RUN export BUILD_NUMBER=${BUILD_NUMBER} && \
export GIT_REF=${GIT_REF} && \
npm run record-build-info
export GIT_REF=${GIT_REF} && \
npm run record-build-info

RUN npm prune --no-audit --production

# Stage: copy production assets and dependencies
FROM base

RUN apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/*

COPY --from=build --chown=appuser:appgroup \
/app/package.json \
/app/package-lock.json \
Expand All @@ -61,7 +63,7 @@ COPY --from=build --chown=appuser:appgroup \
COPY --from=build --chown=appuser:appgroup \
/app/node_modules ./node_modules

EXPOSE 3000
EXPOSE 3000 3001
ENV NODE_ENV='production'
USER 2000

Expand Down
2 changes: 1 addition & 1 deletion helm_deploy/hmpps-audit-poc-ui/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ dependencies:
version: 1.5.0
repository: https://ministryofjustice.github.io/hmpps-helm-charts
- name: generic-prometheus-alerts
version: 0.2.7
version: 1.2.1
repository: https://ministryofjustice.github.io/hmpps-helm-charts

0 comments on commit ff75d73

Please sign in to comment.