FROM index.docker.io/library/ruby:3.3 # Install the runtime interface client for Ruby #RUN gem install aws_lambda_ric # Add the runtime interface client to the PATH ENV PATH="/usr/local/bundle/bin:/opt/bin:${PATH}" RUN cat /etc/ssl/openssl.cnf # https://stackoverflow.com/questions/77812112/what-to-do-if-cipherstring-defaultseclevel-1-in-openssl-3-configuration-file # to interop with our old Ubuntu 12 machines.. RUN sed -i '/\[openssl_init\]/a ssl_conf = ssl_configuration' /etc/ssl/openssl.cnf RUN echo "\n[ssl_configuration]" >> /etc/ssl/openssl.cnf \ && echo "system_default = tls_system_default" >> /etc/ssl/openssl.cnf RUN echo "\n[tls_system_default]" >> /etc/ssl/openssl.cnf \ && echo "MinProtocol = TLSv1" >> /etc/ssl/openssl.cnf \ && echo "CipherString = DEFAULT@SECLEVEL=0" >> /etc/ssl/openssl.cnf # Create a directory for the Lambda function ENV LAMBDA_TASK_ROOT=/var/task RUN mkdir -p ${LAMBDA_TASK_ROOT} WORKDIR ${LAMBDA_TASK_ROOT} ENV ARTIFACT_DIR=/opt ENV FUNCTION_DIR=${LAMBDA_TASK_ROOT} # Install dependencies RUN apt update -y && apt install -y postgresql-common unzip vorbis-tools pip sox python-is-python3 # Copy custom libraries COPY ./assets/bin/ffmpeg ${ARTIFACT_DIR}/bin/ RUN chmod a+x /opt/bin/ffmpeg RUN git clone http://www.pogo.org.uk/~mark/bpm-tools.git && cd bpm-tools && make && cp bpm /opt/bin/ # Copy just enough of the shared gem to satisfy bundle install when it runs. # This way we can make code changes easily in `shared/lib/*`, and not create # full docker rebuilds for speed RUN mkdir -p ${LAMBDA_TASK_ROOT}/shared COPY shared/shared.gemspec ${LAMBDA_TASK_ROOT}/shared/ COPY lambdas ${LAMBDA_TASK_ROOT}/lambdas RUN ls -laR ${LAMBDA_TASK_ROOT} WORKDIR ${LAMBDA_TASK_ROOT}/lambdas/unzipper # Copy Gemfile and Gemfile.lock RUN ls -la RUN gem install bundler && \ bundle config set --local path "/vendor/bundle" && \ bundle install # Copy application code COPY shared ${LAMBDA_TASK_ROOT}/shared #RUN bundle config set --local deployment 'true' && bundle install WORKDIR ${LAMBDA_TASK_ROOT}/lambdas/unzipper # Set runtime interface client as default command for the container runtime #ENTRYPOINT [ "aws_lambda_ric" ] ENTRYPOINT [ "bundle", "exec", "ruby", "app.rb" ]