From 0d6a01acb050836a6b57799fcc6de5858e9aa241 Mon Sep 17 00:00:00 2001 From: Noah Paige Date: Mon, 11 Dec 2023 13:31:58 -0500 Subject: [PATCH] Fix DockerFile commands for vpc facing arch with updates to versions --- .../userguide/docker/prod/Dockerfile | 17 ++++++++++----- frontend/docker/prod/Dockerfile | 21 ++++++++++++------- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/documentation/userguide/docker/prod/Dockerfile b/documentation/userguide/docker/prod/Dockerfile index f06ed9436..8d4f66ba2 100644 --- a/documentation/userguide/docker/prod/Dockerfile +++ b/documentation/userguide/docker/prod/Dockerfile @@ -2,23 +2,30 @@ FROM public.ecr.aws/amazonlinux/amazonlinux:2023 ARG NODE_VERSION=18 ARG PYTHON_VERSION=3.9 -ARG NGINX_VERSION=1.12 +ARG NGINX_VERSION=1.24.0 ARG ENVSUBST_VERSION=v1.1.0 +# Clean cache +RUN dnf upgrade -y;\ + find /var/tmp -name "*.rpm" -print -delete ;\ + find /tmp -name "*.rpm" -print -delete ;\ + dnf autoremove -y; \ + dnf clean all; rm -rfv /var/cache/dnf + +# Installing libraries RUN dnf -y install shadow-utils wget RUN dnf -y install openssl-devel bzip2-devel libffi-devel postgresql-devel gcc unzip tar gzip -RUN dnf install python$PYTHON_VERSION -RUN dnf install nginx$NGINX_VERSION +RUN dnf -y install nginx-$NGINX_VERSION +RUN dnf -y install python$PYTHON_VERSION +RUN dnf -y install python$PYTHON_VERSION-pip RUN touch ~/.bashrc COPY . ./ -RUN python$PYTHON_VERSION -m pip install -U pip RUN python$PYTHON_VERSION -m pip install -r requirements.txt RUN python$PYTHON_VERSION -m mkdocs build - RUN curl -L https://github.com/a8m/envsubst/releases/download/$ENVSUBST_VERSION/envsubst-`uname -s`-`uname -m` -o envsubst && \ chmod +x envsubst && \ mv envsubst /usr/local/bin diff --git a/frontend/docker/prod/Dockerfile b/frontend/docker/prod/Dockerfile index 8aa2683b5..d2188a6a5 100644 --- a/frontend/docker/prod/Dockerfile +++ b/frontend/docker/prod/Dockerfile @@ -2,20 +2,25 @@ FROM public.ecr.aws/amazonlinux/amazonlinux:2023 ARG REACT_APP_STAGE ARG DOMAIN -ARG NODE_VERSION=18 -ARG NGINX_VERSION=1.12 -ARG NVM_VERSION=v0.37.0 +ARG NODE_VERSION=18.19.0 +ARG NGINX_VERSION=1.24.0 +ARG NVM_VERSION=v0.37.2 -RUN dnf update -y && \ - dnf install -y tar gzip openssl && \ - dnf clean all -y -RUN dnf install nginx$NGINX_VERSION +# Clean cache +RUN dnf upgrade -y;\ + find /var/tmp -name "*.rpm" -print -delete ;\ + find /tmp -name "*.rpm" -print -delete ;\ + dnf autoremove -y; \ + dnf clean all; rm -rfv /var/cache/dnf + +# Installing libraries +RUN dnf install -y tar gzip openssl nginx-$NGINX_VERSION RUN touch ~/.bashrc RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/$NVM_VERSION/install.sh | bash RUN . ~/.nvm/nvm.sh && nvm install node -RUN echo '. ~/.nvm/nvm.sh' >> ~/.bashrc +RUN echo '. ~/.nvm/nvm.sh' >> ~/.bashrc RUN . ~/.nvm/nvm.sh && npm install -g npm@9 yarn