Skip to content

Commit

Permalink
Fix DockerFile commands for vpc facing arch with updates to versions (#…
Browse files Browse the repository at this point in the history
…907)

### Feature or Bugfix
<!-- please choose -->
- Bugfix

### Detail
- Fix docker image used on VPC Facing Deployments to successfully build
frontend + userguide images to host in ECS

### Relates
- #889

### Security
Please answer the questions below briefly where applicable, or write
`N/A`. Based on
[OWASP 10](https://owasp.org/Top10/en/).

- Does this PR introduce or modify any input fields or queries - this
includes
fetching data from storage outside the application (e.g. a database, an
S3 bucket)?
N/A
  - Is the input sanitized? N/A
- What precautions are you taking before deserializing the data you
consume? N/A
  - Is injection prevented by parametrizing queries? N/A
  - Have you ensured no `eval` or similar functions are used? Yes
- Does this PR introduce any functionality or component that requires
authorization? No
- How have you ensured it respects the existing AuthN/AuthZ mechanisms?
N/A
  - Are you logging failed auth attempts? N/A
- Are you using or adding any cryptographic features? N/A
  - Do you use a standard proven implementations? Yes
- Are the used keys controlled by the customer? Where are they stored?
N/A
- Are you introducing any new policies/roles/users? No
  - Have you used the least-privilege principle? How? N/A


By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.
  • Loading branch information
noah-paige authored Dec 12, 2023
1 parent 94c93d9 commit c7e2c85
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 13 deletions.
17 changes: 12 additions & 5 deletions documentation/userguide/docker/prod/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 13 additions & 8 deletions frontend/docker/prod/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit c7e2c85

Please sign in to comment.