From 01d2a96c80ed8d3be91c014211cf20c15dd4b04d Mon Sep 17 00:00:00 2001 From: Kris Szlapa Date: Tue, 8 Oct 2024 17:07:21 +0100 Subject: [PATCH] Build: [AEA-4069] - Deployment Process Improvement (#8) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary 🎫 [AEA-4069](https://nhsd-jira.digital.nhs.uk/browse/AEA-4069) Create NPPTS CloudWatch Dashboard - Routine Change - :robot: Operational or Infrastructure Change ### Details Deployment Process Improvement --- docker/Dockerfile | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 08deb63..ad41af9 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,10 +1,16 @@ FROM ubuntu:24.04 + RUN apt-get update \ && export DEBIAN_FRONTEND=noninteractive \ - && apt-get -y upgrade - -RUN export DEBIAN_FRONTEND=noninteractive \ - && apt-get -y install --no-install-recommends jq unzip wget ca-certificates make git curl + && apt-get -y upgrade \ + && apt-get -y install --no-install-recommends htop vim curl git build-essential \ + libffi-dev libssl-dev libxml2-dev libxslt1-dev libjpeg8-dev libbz2-dev \ + zlib1g-dev unixodbc unixodbc-dev libsecret-1-0 libsecret-1-dev libsqlite3-dev \ + jq apt-transport-https ca-certificates gnupg-agent \ + software-properties-common bash-completion python3-pip make libbz2-dev \ + libreadline-dev libsqlite3-dev wget llvm libncurses5-dev libncursesw5-dev \ + xz-utils tk-dev liblzma-dev libyaml-dev bats bats-support bats-assert bats-file \ + python3 python3-pip python3-dev unzip # Install AWS stuff RUN wget -O /tmp/awscliv2.zip "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" && \ @@ -27,14 +33,24 @@ RUN git clone https://github.com/asdf-vm/asdf.git /home/cdkuser/.asdf --branch v ENV PATH="$PATH:/home/cdkuser/.asdf/bin/:/home/cdkuser/node_modules/.bin" # Install ASDF plugins -RUN asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git +RUN asdf plugin add shellcheck https://github.com/luizm/asdf-shellcheck.git; \ + asdf plugin add actionlint; \ + asdf plugin add python; \ + asdf plugin add nodejs https://github.com/asdf-vm/asdf-nodejs.git; \ + asdf plugin add poetry https://github.com/asdf-community/asdf-poetry.git; \ + asdf plugin add direnv; \ + asdf plugin add actionlint; \ + asdf plugin add ruby https://github.com/asdf-vm/asdf-ruby.git -# Remove ruby, python, poetry from asdf install +# Copy local asdf folder to make the build faster +COPY --chown=cdkuser .asdf /home/cdkuser/.asdf COPY --chown=cdkuser .tool-versions /home/cdkuser/.tool-versions -RUN sed -i -n '/nodejs/p' /home/cdkuser/.tool-versions RUN asdf install; \ - asdf reshim nodejs + asdf reshim python; \ + asdf reshim poetry; \ + asdf reshim nodejs; \ + asdf direnv setup --shell bash --version 2.32.2; # Copy files needed for deployment COPY --chown=cdkuser packages /home/cdkuser/packages