Skip to content

Commit 02b0af2

Browse files
committed
refactor: api gateway from cpt for reuse
1 parent d290ad0 commit 02b0af2

File tree

77 files changed

+19198
-3876
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+19198
-3876
lines changed

.devcontainer/Dockerfile

Lines changed: 13 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,16 @@
1-
FROM mcr.microsoft.com/devcontainers/base:ubuntu
2-
3-
ARG TARGETARCH
4-
ENV TARGETARCH=${TARGETARCH}
5-
6-
ARG ASDF_VERSION
7-
COPY .tool-versions.asdf /tmp/.tool-versions.asdf
8-
9-
RUN apt-get update \
10-
&& export DEBIAN_FRONTEND=noninteractive \
11-
&& apt-get -y dist-upgrade \
12-
&& apt-get -y install --no-install-recommends htop vim curl git build-essential \
13-
libffi-dev libssl-dev libxml2-dev libxslt1-dev libjpeg8-dev libbz2-dev \
14-
zlib1g-dev unixodbc unixodbc-dev libsecret-1-0 libsecret-1-dev libsqlite3-dev \
15-
jq apt-transport-https ca-certificates gnupg-agent \
16-
software-properties-common bash-completion python3-pip make libbz2-dev \
17-
libreadline-dev libsqlite3-dev wget llvm libncurses5-dev libncursesw5-dev \
18-
xz-utils tk-dev liblzma-dev libyaml-dev
19-
20-
21-
# Download correct AWS CLI for arch
22-
RUN if [ "$TARGETARCH" = "arm64" ] || [ "$TARGETARCH" == "aarch64" ]; then \
23-
wget -O /tmp/awscliv2.zip "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip"; \
1+
ARG IMAGE_NAME=node_24_python_3_14
2+
ARG IMAGE_VERSION=latest
3+
FROM ghcr.io/nhsdigital/eps-devcontainers/${IMAGE_NAME}:${IMAGE_VERSION}
4+
5+
USER root
6+
# specify DOCKER_GID to force container docker group id to match host
7+
RUN if [ -n "${DOCKER_GID}" ]; then \
8+
if ! getent group docker; then \
9+
groupadd -g ${DOCKER_GID} docker; \
2410
else \
25-
wget -O /tmp/awscliv2.zip "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip"; \
11+
groupmod -g ${DOCKER_GID} docker; \
2612
fi && \
27-
unzip /tmp/awscliv2.zip -d /tmp/aws-cli && \
28-
/tmp/aws-cli/aws/install && \
29-
rm /tmp/awscliv2.zip && rm -rf /tmp/aws-cli
30-
31-
# Download correct SAM CLI for arch
32-
RUN if [ "$TARGETARCH" = "arm64" ] || [ "$TARGETARCH" == "aarch64" ]; then \
33-
wget -O /tmp/aws-sam-cli.zip "https://github.com/aws/aws-sam-cli/releases/latest/download/aws-sam-cli-linux-arm64.zip"; \
34-
else \
35-
wget -O /tmp/aws-sam-cli.zip "https://github.com/aws/aws-sam-cli/releases/latest/download/aws-sam-cli-linux-x86_64.zip"; \
36-
fi && \
37-
unzip /tmp/aws-sam-cli.zip -d /tmp/aws-sam-cli && \
38-
/tmp/aws-sam-cli/install && \
39-
rm /tmp/aws-sam-cli.zip && rm -rf /tmp/aws-sam-cli
40-
41-
# Install ASDF
42-
RUN ASDF_VERSION=$(awk '!/^#/ && NF {print $1; exit}' /tmp/.tool-versions.asdf) && \
43-
if [ "$TARGETARCH" = "arm64" ] || [ "$TARGETARCH" = "aarch64" ]; then \
44-
wget -O /tmp/asdf.tar.gz https://github.com/asdf-vm/asdf/releases/download/v${ASDF_VERSION}/asdf-v${ASDF_VERSION}-linux-arm64.tar.gz; \
45-
else \
46-
wget -O /tmp/asdf.tar.gz https://github.com/asdf-vm/asdf/releases/download/v${ASDF_VERSION}/asdf-v${ASDF_VERSION}-linux-amd64.tar.gz; \
47-
fi && \
48-
tar -xvzf /tmp/asdf.tar.gz && \
49-
mv asdf /usr/bin
50-
51-
52-
USER vscode
53-
54-
ENV PATH="$PATH:/home/vscode/.asdf/shims/:/workspaces/eps-cdk-utils/node_modules/.bin"
55-
56-
# Install ASDF plugins
57-
RUN asdf plugin add python; \
58-
asdf plugin add poetry https://github.com/asdf-community/asdf-poetry.git; \
59-
asdf plugin add shellcheck https://github.com/luizm/asdf-shellcheck.git; \
60-
asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git; \
61-
asdf plugin add direnv; \
62-
asdf plugin add actionlint;
63-
64-
WORKDIR /workspaces/eps-workflow-quality-checks
65-
66-
ADD .tool-versions /workspaces/eps-cdk-utils/.tool-versions
67-
ADD .tool-versions /home/vscode/.tool-versions
13+
usermod -aG docker vscode; \
14+
fi
6815

69-
RUN asdf install python; \
70-
asdf install
16+
RUN apt-get update && apt-get install -y --no-install-recommends git-secrets && rm -rf /var/lib/apt/lists/*

.devcontainer/devcontainer.json

Lines changed: 45 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,49 @@
1-
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2-
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
31
{
4-
"name": "Ubuntu",
5-
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6-
"build": {
7-
"dockerfile": "Dockerfile",
8-
"context": "..",
9-
"args": {}
10-
},
11-
"mounts": [
12-
"source=${env:HOME}${env:USERPROFILE}/.aws,target=/home/vscode/.aws,type=bind",
13-
"source=${env:HOME}${env:USERPROFILE}/.ssh,target=/home/vscode/.ssh,type=bind",
14-
"source=${env:HOME}${env:USERPROFILE}/.gnupg,target=/home/vscode/.gnupg,type=bind",
15-
"source=${env:HOME}${env:USERPROFILE}/.npmrc,target=/home/vscode/.npmrc,type=bind"
16-
],
17-
"features": {
18-
"ghcr.io/devcontainers/features/github-cli:1": {},
19-
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {
20-
"version": "latest",
21-
"moby": "true",
22-
"installDockerBuildx": "true"
23-
}
24-
},
25-
"remoteEnv": { "LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}" },
26-
"containerUser": "vscode",
27-
"customizations": {
28-
"vscode": {
29-
"extensions": [
30-
"AmazonWebServices.aws-toolkit-vscode",
31-
"redhat.vscode-yaml",
32-
"eamodio.gitlens",
33-
"github.vscode-pull-request-github",
34-
"streetsidesoftware.code-spell-checker",
35-
"timonwong.shellcheck",
36-
"github.vscode-github-actions"
37-
],
38-
"settings": {
39-
"cSpell.words": ["fhir", "Formik", "pino", "serialisation"]
40-
}
2+
"name": "eps-cdk-utils",
3+
"build": {
4+
"dockerfile": "Dockerfile",
5+
"context": "..",
6+
"args": {
7+
"DOCKER_GID": "${env:DOCKER_GID:}",
8+
"IMAGE_NAME": "node_24_python_3_14",
9+
"IMAGE_VERSION": "v1.0.7",
10+
"USER_UID": "${localEnv:USER_ID:}",
11+
"USER_GID": "${localEnv:GROUP_ID:}"
12+
}
13+
},
14+
"postAttachCommand": "git-secrets --register-aws; git-secrets --add-provider -- cat /usr/share/secrets-scanner/nhsd-rules-deny.txt",
15+
"mounts": [
16+
"source=${env:HOME}${env:USERPROFILE}/.aws,target=/home/vscode/.aws,type=bind",
17+
"source=${env:HOME}${env:USERPROFILE}/.ssh,target=/home/vscode/.ssh,type=bind",
18+
"source=${env:HOME}${env:USERPROFILE}/.gnupg,target=/home/vscode/.gnupg,type=bind",
19+
"source=${env:HOME}${env:USERPROFILE}/.npmrc,target=/home/vscode/.npmrc,type=bind"
20+
],
21+
"features": {},
22+
"remoteEnv": {
23+
"LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}"
24+
},
25+
"containerUser": "vscode",
26+
"customizations": {
27+
"vscode": {
28+
"extensions": [
29+
"AmazonWebServices.aws-toolkit-vscode",
30+
"redhat.vscode-yaml",
31+
"eamodio.gitlens",
32+
"github.vscode-pull-request-github",
33+
"streetsidesoftware.code-spell-checker",
34+
"timonwong.shellcheck",
35+
"github.vscode-github-actions",
36+
"dbaeumer.vscode-eslint",
37+
"vitest.explorer"
38+
],
39+
"settings": {
40+
"cSpell.words": [
41+
"fhir",
42+
"Formik",
43+
"pino",
44+
"serialisation"
45+
]
4146
}
4247
}
4348
}
49+
}

.github/dependabot.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,34 +10,34 @@ updates:
1010
directory: "/"
1111
schedule:
1212
interval: "weekly"
13-
day: "friday"
13+
day: "thursday"
1414
time: "18:00" #UTC
1515
commit-message:
1616
prefix: "Upgrade: [dependabot] - "
1717

1818
###################################
19-
# NPM workspace ##################
19+
# Poetry #########################
2020
###################################
21-
- package-ecosystem: "npm"
21+
- package-ecosystem: "pip"
2222
directory: "/"
2323
schedule:
2424
interval: "weekly"
25-
day: "friday"
26-
time: "18:00" #UTC
25+
day: "thursday"
26+
time: "20:00" #UTC
2727
versioning-strategy: increase
28-
open-pull-requests-limit: 20
2928
commit-message:
3029
prefix: "Upgrade: [dependabot] - "
3130

3231
###################################
33-
# Poetry #########################
32+
# NPM workspace ##################
3433
###################################
35-
- package-ecosystem: "pip"
34+
- package-ecosystem: "npm"
3635
directory: "/"
3736
schedule:
3837
interval: "weekly"
39-
day: "friday"
40-
time: "18:00" #UTC
38+
day: "thursday"
39+
time: "22:00" #UTC
4140
versioning-strategy: increase
41+
open-pull-requests-limit: 20
4242
commit-message:
4343
prefix: "Upgrade: [dependabot] - "

.github/scripts/check_ecr_image_scan_results.sh

Lines changed: 0 additions & 138 deletions
This file was deleted.

0 commit comments

Comments
 (0)