From 4c1abc42ed90d2b7206a024309b1a57346047365 Mon Sep 17 00:00:00 2001 From: Sampo Tawast Date: Wed, 11 Sep 2024 13:24:28 +0300 Subject: [PATCH] chore: further optimize dockerfiles --- backend/docker/benefit-ubi-arm.Dockerfile | 16 ++++++++-------- backend/docker/benefit.Dockerfile | 13 +++++++------ 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/backend/docker/benefit-ubi-arm.Dockerfile b/backend/docker/benefit-ubi-arm.Dockerfile index e6a26a7c62..a301e90a3a 100644 --- a/backend/docker/benefit-ubi-arm.Dockerfile +++ b/backend/docker/benefit-ubi-arm.Dockerfile @@ -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 diff --git a/backend/docker/benefit.Dockerfile b/backend/docker/benefit.Dockerfile index 952cc66f42..c6b273a670 100644 --- a/backend/docker/benefit.Dockerfile +++ b/backend/docker/benefit.Dockerfile @@ -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 \ @@ -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