From 667b329b9e92923015eeb8f97fc7fb9f45b17b0d Mon Sep 17 00:00:00 2001 From: Jack Spagnoli Date: Tue, 24 Mar 2026 12:15:36 +0000 Subject: [PATCH] adds eps-data-extract image --- Makefile | 7 +++- .../.devcontainer/.tool-versions | 2 + .../eps-data-extract/.devcontainer/Dockerfile | 39 +++++++++++++++++++ .../.devcontainer/devcontainer.json | 18 +++++++++ .../.devcontainer/scripts/root_install.sh | 7 ++++ .../.devcontainer/scripts/vscode_install.sh | 10 +++++ .../eps-data-extract/.trivyignore.yaml | 1 + src/projects/eps-data-extract/trivy.yaml | 1 + 8 files changed, 83 insertions(+), 2 deletions(-) create mode 100644 src/projects/eps-data-extract/.devcontainer/.tool-versions create mode 100644 src/projects/eps-data-extract/.devcontainer/Dockerfile create mode 100644 src/projects/eps-data-extract/.devcontainer/devcontainer.json create mode 100755 src/projects/eps-data-extract/.devcontainer/scripts/root_install.sh create mode 100755 src/projects/eps-data-extract/.devcontainer/scripts/vscode_install.sh create mode 100644 src/projects/eps-data-extract/.trivyignore.yaml create mode 100644 src/projects/eps-data-extract/trivy.yaml diff --git a/Makefile b/Makefile index 08da340..40646c3 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ guard-%: fi .PHONY: install install-python install-node install-hooks build-base-image build-node-24-image build-node-24-python-3-10-image build-node-24-python-3-12-image build-node-24-python-3-13-image build-node-24-python-3-14-image \ - build-eps-storage-terraform-image build-fhir-facade-image build-node-24-python-3-14-golang-1-24-image build-node-24-python-3-14-java-24-image \ + build-eps-storage-terraform-image build-eps-data-extract-image build-fhir-facade-image build-node-24-python-3-14-golang-1-24-image build-node-24-python-3-14-java-24-image \ build-regression-tests-image build-all build-image build-githubactions-image scan-image scan-image-json shell-image lint test lint-githubactions lint-githubaction-scripts clean install: install-python install-node install-hooks @@ -45,6 +45,9 @@ build-node-24-python-3-14-image: build-eps-storage-terraform-image: CONTAINER_NAME=eps_storage_terraform BASE_VERSION_TAG=local-build BASE_FOLDER=projects IMAGE_TAG=local-build $(MAKE) build-image +build-eps-data-extract-image: + CONTAINER_NAME=eps_data_extract BASE_VERSION_TAG=local-build BASE_FOLDER=projects IMAGE_TAG=local-build $(MAKE) build-image + build-fhir-facade-image: CONTAINER_NAME=fhir_facade_api BASE_VERSION_TAG=local-build BASE_FOLDER=projects IMAGE_TAG=local-build $(MAKE) build-image @@ -58,7 +61,7 @@ build-regression-tests-image: CONTAINER_NAME=regression_tests BASE_VERSION_TAG=local-build BASE_FOLDER=projects IMAGE_TAG=local-build $(MAKE) build-image build-all: build-base-image build-node-24-image build-node-24-python-3-10-image build-node-24-python-3-12-image build-node-24-python-3-13-image build-node-24-python-3-14-image \ - build-eps-storage-terraform-image build-fhir-facade-image build-node-24-python-3-14-golang-1-24-image build-node-24-python-3-14-java-24-image \ + build-eps-storage-terraform-image build-eps-data-extract-image build-fhir-facade-image build-node-24-python-3-14-golang-1-24-image build-node-24-python-3-14-java-24-image \ build-regression-tests-image build-image: guard-CONTAINER_NAME guard-BASE_VERSION_TAG guard-BASE_FOLDER guard-IMAGE_TAG diff --git a/src/projects/eps-data-extract/.devcontainer/.tool-versions b/src/projects/eps-data-extract/.devcontainer/.tool-versions new file mode 100644 index 0000000..e532f3e --- /dev/null +++ b/src/projects/eps-data-extract/.devcontainer/.tool-versions @@ -0,0 +1,2 @@ +java temurin-17.0.18+8 +maven 3.9.13 diff --git a/src/projects/eps-data-extract/.devcontainer/Dockerfile b/src/projects/eps-data-extract/.devcontainer/Dockerfile new file mode 100644 index 0000000..44dcde1 --- /dev/null +++ b/src/projects/eps-data-extract/.devcontainer/Dockerfile @@ -0,0 +1,39 @@ +ARG BASE_VERSION_TAG=latest +ARG BASE_IMAGE=ghcr.io/nhsdigital/eps-devcontainers/node_24_python_3_14:${BASE_VERSION_TAG} + +FROM ${BASE_IMAGE} + +ARG SCRIPTS_DIR=/usr/local/share/eps +ARG CONTAINER_NAME +ARG MULTI_ARCH_TAG +ARG BASE_VERSION_TAG +ARG IMAGE_TAG +ARG TARGETARCH + +ENV SCRIPTS_DIR=${SCRIPTS_DIR} +ENV CONTAINER_NAME=${CONTAINER_NAME} +ENV MULTI_ARCH_TAG=${MULTI_ARCH_TAG} +ENV BASE_VERSION_TAG=${BASE_VERSION_TAG} +ENV IMAGE_TAG=${IMAGE_TAG} +ENV TARGETARCH=${TARGETARCH} + +LABEL org.opencontainers.image.description="EPS devcontainer ${CONTAINER_NAME}:${IMAGE_TAG}" +LABEL org.opencontainers.image.version=${IMAGE_TAG} +LABEL org.opencontainers.image.base.name=${BASE_IMAGE} +LABEL org.opencontainers.image.containerName=${CONTAINER_NAME} + +USER root +COPY --chmod=755 scripts ${SCRIPTS_DIR}/${CONTAINER_NAME} +WORKDIR ${SCRIPTS_DIR}/${CONTAINER_NAME} +RUN ./root_install.sh + +USER vscode + +WORKDIR ${SCRIPTS_DIR}/${CONTAINER_NAME} +COPY .tool-versions /tmp/.tool-versions +RUN cat /tmp/.tool-versions >> /home/vscode/.tool-versions + +RUN ./vscode_install.sh + +# Switch back to root to install the devcontainer CLI globally +USER root diff --git a/src/projects/eps-data-extract/.devcontainer/devcontainer.json b/src/projects/eps-data-extract/.devcontainer/devcontainer.json new file mode 100644 index 0000000..8b10457 --- /dev/null +++ b/src/projects/eps-data-extract/.devcontainer/devcontainer.json @@ -0,0 +1,18 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu +{ + "name": "EPS Devcontainer for Data Extract", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "build": { + "dockerfile": "Dockerfile", + "args": { + "CONTAINER_NAME": "eps_devcontainer_${localEnv:CONTAINER_NAME}", + "MULTI_ARCH_TAG": "${localEnv:MULTI_ARCH_TAG}", + "BASE_VERSION_TAG": "${localEnv:BASE_VERSION_TAG}", + "IMAGE_TAG": "${localEnv:IMAGE_TAG}" + }, + "context": "." + }, + "features": {} + } + diff --git a/src/projects/eps-data-extract/.devcontainer/scripts/root_install.sh b/src/projects/eps-data-extract/.devcontainer/scripts/root_install.sh new file mode 100755 index 0000000..52fa2b1 --- /dev/null +++ b/src/projects/eps-data-extract/.devcontainer/scripts/root_install.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +set -e +export DEBIAN_FRONTEND=noninteractive + +# clean up +apt-get clean +rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* diff --git a/src/projects/eps-data-extract/.devcontainer/scripts/vscode_install.sh b/src/projects/eps-data-extract/.devcontainer/scripts/vscode_install.sh new file mode 100755 index 0000000..6c60393 --- /dev/null +++ b/src/projects/eps-data-extract/.devcontainer/scripts/vscode_install.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +set -e + +asdf plugin add java +asdf plugin add maven + +asdf install + +# install cfn-lint +pip install --user cfn-lint diff --git a/src/projects/eps-data-extract/.trivyignore.yaml b/src/projects/eps-data-extract/.trivyignore.yaml new file mode 100644 index 0000000..8697da6 --- /dev/null +++ b/src/projects/eps-data-extract/.trivyignore.yaml @@ -0,0 +1 @@ +vulnerabilities: diff --git a/src/projects/eps-data-extract/trivy.yaml b/src/projects/eps-data-extract/trivy.yaml new file mode 100644 index 0000000..b78bad6 --- /dev/null +++ b/src/projects/eps-data-extract/trivy.yaml @@ -0,0 +1 @@ +ignorefile: "src/projects/eps-data-extract/.trivyignore_combined.yaml"