Skip to content

Commit

Permalink
chore: further optimize dockerfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
sirtawast committed Sep 11, 2024
1 parent 9cb0cd4 commit 4c1abc4
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
16 changes: 8 additions & 8 deletions backend/docker/benefit-ubi-arm.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,21 @@ RUN dnf update -y \
xmlsec1 \
xmlsec1-openssl \
cyrus-sasl-devel \
openssl-devel
RUN pip install -U pip \
openssl-devel \
&& pip install -U pip \
&& pip install --no-cache-dir -r /app/requirements.txt \
&& pip install --no-cache-dir -r /app/requirements-prod.txt \
&& uwsgi --build-plugin /app/.prod/escape_json.c \
&& mv /app/escape_json_plugin.so /app/.prod/escape_json_plugin.so \
&& dnf remove -y gcc cyrus-sasl-devel openssl-devel \
&& dnf clean all
&& dnf remove -y gcc cyrus-sasl-devel openssl-devel

# Install wkhtmltopdf and it's deps from CentOS9 repo and binary
COPY --chown=default:root docker/ubi/centos9-aarch.repo /etc/yum.repos.d/centos9.repo
RUN rpm --import https://www.centos.org/keys/RPM-GPG-KEY-CentOS-Official
RUN dnf install -y xorg-x11-server-Xvfb compat-openssl11
RUN wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox-0.12.6.1-3.almalinux8.aarch64.rpm && dnf localinstall -y wkhtmltox-0.12.6.1-3.almalinux8.aarch64.rpm
RUN rm -f /etc/yum.repos.d/centos9.repo
RUN rpm --import https://www.centos.org/keys/RPM-GPG-KEY-CentOS-Official \
&& dnf install -y xorg-x11-server-Xvfb compat-openssl11 \
&& wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox-0.12.6.1-3.almalinux8.aarch64.rpm \
&& dnf localinstall -y wkhtmltox-0.12.6.1-3.almalinux8.aarch64.rpm \
&& rm -f /etc/yum.repos.d/centos9.repo && rm -f wkhtmltox-0.12.6.1-3.almalinux8.aarch64.rpm && dnf clean all

COPY --chown=default:root /benefit/ /app/
# Mark the app directory as safe to get rid of git's
Expand Down
13 changes: 7 additions & 6 deletions backend/docker/benefit.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ RUN dnf update -y \
xmlsec1 \
xmlsec1-openssl \
cyrus-sasl-devel \
openssl-devel
RUN pip install -U pip \
openssl-devel \
&& pip install -U pip \
&& pip install --no-cache-dir -r /app/requirements.txt \
&& pip install --no-cache-dir -r /app/requirements-prod.txt \
&& uwsgi --build-plugin /app/.prod/escape_json.c \
Expand All @@ -34,10 +34,11 @@ RUN pip install -U pip \

# Install wkhtmltopdf and it's deps from CentOS9 repo and binary
COPY --chown=default:root docker/ubi/centos9.repo /etc/yum.repos.d/centos9.repo
RUN rpm --import https://www.centos.org/keys/RPM-GPG-KEY-CentOS-Official
RUN dnf install -y xorg-x11-server-Xvfb compat-openssl11
RUN wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox-0.12.6.1-3.fedora37.x86_64.rpm && dnf localinstall -y wkhtmltox-0.12.6.1-3.fedora37.x86_64.rpm
RUN rm -f /etc/yum.repos.d/centos9.repo && rm -f wkhtmltox-0.12.6.1-3.fedora37.x86_64.rpm && dnf clean all
RUN rpm --import https://www.centos.org/keys/RPM-GPG-KEY-CentOS-Official \
&& dnf install -y xorg-x11-server-Xvfb compat-openssl11 \
&& wget https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox-0.12.6.1-3.fedora37.x86_64.rpm \
&& dnf localinstall -y wkhtmltox-0.12.6.1-3.fedora37.x86_64.rpm \
&& rm -f /etc/yum.repos.d/centos9.repo && rm -f wkhtmltox-0.12.6.1-3.fedora37.x86_64.rpm && dnf clean all

COPY --chown=default:root /benefit/ /app/
# Mark the app directory as safe to get rid of git's
Expand Down

0 comments on commit 4c1abc4

Please sign in to comment.