From 7437b718f84b01984c6021460138a6354a81a19e Mon Sep 17 00:00:00 2001 From: hselvakumar Date: Mon, 12 Feb 2024 10:39:14 +0000 Subject: [PATCH 1/2] Node v20 Docker changes --- .dockerignore | 1 + Dockerfile | 3 ++- Tiltfile.dev | 4 ++-- docker_start.sh | 1 - version | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.dockerignore b/.dockerignore index b792ac6..c623e41 100644 --- a/.dockerignore +++ b/.dockerignore @@ -7,3 +7,4 @@ !package-lock.json !package.json !tsconfig.json +!node_modules diff --git a/Dockerfile b/Dockerfile index 6a75374..c880e0d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,8 @@ -FROM 416670754337.dkr.ecr.eu-west-2.amazonaws.com/ci-node-runtime-18 +FROM 416670754337.dkr.ecr.eu-west-2.amazonaws.com/ci-node-runtime-20 WORKDIR /opt COPY api-enumerations ./api-enumerations COPY dist ./package.json ./package-lock.json docker_start.sh ./ +COPY node_modules ./node_modules CMD ["./docker_start.sh"] diff --git a/Tiltfile.dev b/Tiltfile.dev index 9076ef0..e1eae01 100644 --- a/Tiltfile.dev +++ b/Tiltfile.dev @@ -7,7 +7,7 @@ local_resource( custom_build( ref = '416670754337.dkr.ecr.eu-west-2.amazonaws.com/strike-off-objections-web', #the following build-command was updated as specified by https://github.com/companieshouse/docker-chs-development/pull/581 - command = 'DOCKER_BUILDKIT=0 docker build --build-arg SSH_PRIVATE_KEY="$(ssh_key_path="$(ssh -G github.com | grep -e \'^identityfile.*\' | head -n1 | sed \'s|^identityfile \\(.*\\)|\\1|\')"; if [ -z "${ssh_key_path}" ]; then echo "Could not find ssh key path for github.com">&2; false; elif [ -f "${ssh_key_path}" ]; then cat "${ssh_key_path}"; else echo "Could not find ssh key for github at ${ssh_key_path}" >&2; false; fi)" --build-arg SSH_PRIVATE_KEY_PASSPHRASE --tag $EXPECTED_REF .', + command = 'docker build --build-arg SSH_PRIVATE_KEY="$(ssh_key_path="$(ssh -G github.com | grep -e \'^identityfile.*\' | head -n1 | sed \'s|^identityfile \\(.*\\)|\\1|\')"; if [ -z "${ssh_key_path}" ]; then echo "Could not find ssh key path for github.com">&2; false; elif [ -f "${ssh_key_path}" ]; then cat "${ssh_key_path}"; else echo "Could not find ssh key for github at ${ssh_key_path}" >&2; false; fi)" --build-arg SSH_PRIVATE_KEY_PASSPHRASE --tag $EXPECTED_REF .', live_update = [ sync( local_path = './src', @@ -17,6 +17,6 @@ custom_build( ], deps = [ './dist', - './src' + './opt' ] ) diff --git a/docker_start.sh b/docker_start.sh index 2b6b698..4f44d96 100755 --- a/docker_start.sh +++ b/docker_start.sh @@ -1,7 +1,6 @@ #!/bin/bash # # Start script for applications.developer.ch.gov.uk -npm i PORT=3000 export NODE_PORT=${PORT} diff --git a/version b/version index cd5ac03..879b416 100644 --- a/version +++ b/version @@ -1 +1 @@ -2.0 +2.1 From ebefb680d7d090616979eb88c72571878ddbad46 Mon Sep 17 00:00:00 2001 From: hselvakumar Date: Mon, 12 Feb 2024 10:45:46 +0000 Subject: [PATCH 2/2] Node v20 Docker changes --- Tiltfile.dev | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tiltfile.dev b/Tiltfile.dev index e1eae01..481ac88 100644 --- a/Tiltfile.dev +++ b/Tiltfile.dev @@ -11,12 +11,12 @@ custom_build( live_update = [ sync( local_path = './src', - remote_path = '/app/src' + remote_path = '/opt/src' ), restart_container() ], deps = [ './dist', - './opt' + './src' ] )