From c344d70279526f75543e84cb9c5f0c8e675e2f4a Mon Sep 17 00:00:00 2001 From: Rhett Reisman Date: Sat, 27 Jul 2024 14:34:42 -0500 Subject: [PATCH] Update Dockerfile --- Dockerfile | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1cbbdef..2ce2822 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,11 +4,26 @@ FROM public.ecr.aws/lambda/python:3.9 # Set up the work directory WORKDIR /var/task -# Install necessary build tools, Rust, and OpenSSL development package -RUN yum install -y zip gcc python3-devel libffi-devel openssl-devel && \ +# Install necessary build tools, Rust, and OpenSSL +RUN yum install -y zip gcc python3-devel libffi-devel && \ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \ echo 'source $HOME/.cargo/env' >> $HOME/.bashrc && \ - source $HOME/.cargo/env + source $HOME/.cargo/env && \ + yum install -y wget && \ + wget https://www.openssl.org/source/openssl-1.1.1k.tar.gz && \ + tar -xzvf openssl-1.1.1k.tar.gz && \ + cd openssl-1.1.1k && \ + ./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl shared zlib && \ + make && make install && \ + echo "/usr/local/ssl/lib" > /etc/ld.so.conf.d/openssl-1.1.1k.conf && \ + ldconfig && \ + cd .. && rm -rf openssl-1.1.1k* + +# Set OpenSSL environment variables +ENV LDFLAGS="-L/usr/local/ssl/lib" +ENV CPPFLAGS="-I/usr/local/ssl/include" +ENV LD_LIBRARY_PATH="/usr/local/ssl/lib" +ENV PATH="/usr/local/ssl/bin:${PATH}" # Copy your application code and requirements.txt into the Docker image COPY . .