diff --git a/.github/workflows/services.yml b/.github/workflows/services.yml index 202a478c7..426432371 100644 --- a/.github/workflows/services.yml +++ b/.github/workflows/services.yml @@ -61,7 +61,7 @@ jobs: { "identifier": "switch-services-staging", "environment": "staging", - "branch": "develop", + "branch": "use_official_aws_lambda_images", "image_tag": "staging" }, { diff --git a/components/services/Dockerfile b/components/services/Dockerfile index 8d319b935..83b8918ad 100644 --- a/components/services/Dockerfile +++ b/components/services/Dockerfile @@ -1,10 +1,9 @@ ARG FUNCTION_DIR="/function" ARG RUBY_VERSION=3.3 -FROM public.ecr.aws/docker/library/ruby:$RUBY_VERSION-alpine AS build-image +FROM public.ecr.aws/lambda/ruby:$RUBY_VERSION AS build-image -RUN apk update && \ - apk upgrade && \ - apk add --update --no-cache build-base postgresql-dev +RUN dnf update && \ + dnf -y install postgresql-devel openssl-devel gcc make RUN gem install bundler @@ -28,9 +27,9 @@ COPY app/ ${FUNCTION_DIR}/app/ COPY config/ ${FUNCTION_DIR}/config/ COPY lib/ ${FUNCTION_DIR}/lib/ -############################# +# ############################# -FROM public.ecr.aws/docker/library/ruby:$RUBY_VERSION-alpine +FROM public.ecr.aws/lambda/ruby:$RUBY_VERSION ARG FUNCTION_DIR WORKDIR ${FUNCTION_DIR} @@ -38,13 +37,9 @@ WORKDIR ${FUNCTION_DIR} ENV BUNDLE_APP_CONFIG="${FUNCTION_DIR}/.bundle" COPY --from=build-image ${FUNCTION_DIR} ${FUNCTION_DIR} -RUN apk update && \ - apk upgrade && \ - apk add --update --no-cache postgresql-dev && \ - gem install bundler && \ - gem install aws_lambda_ric +RUN dnf update && \ + dnf -y install postgresql-devel ENV RUBY_YJIT_ENABLE=true -ENTRYPOINT [ "/usr/local/bundle/bin/aws_lambda_ric" ] CMD [ "app.App::Handler.process" ] diff --git a/components/services/config/app_settings.rb b/components/services/config/app_settings.rb index 3598dd7ee..03f1bfdc7 100644 --- a/components/services/config/app_settings.rb +++ b/components/services/config/app_settings.rb @@ -1,5 +1,6 @@ require "yaml" require "erb" +require "pathname" class AppSettings DEFAULT_SETTINGS_PATH = Pathname(File.expand_path("app_settings.yml", __dir__)) diff --git a/components/services/config/initializers/aws_stubs.rb b/components/services/config/initializers/aws_stubs.rb index 8e1a688c9..6ef4ee8e1 100644 --- a/components/services/config/initializers/aws_stubs.rb +++ b/components/services/config/initializers/aws_stubs.rb @@ -1,3 +1,5 @@ +require "aws-sdk-core" + if %w[development test].include?(AppSettings.env) Aws.config[:ssm] = { stub_responses: { diff --git a/components/services/lib/encrypted_credentials.rb b/components/services/lib/encrypted_credentials.rb index b7808153f..da7e97229 100644 --- a/components/services/lib/encrypted_credentials.rb +++ b/components/services/lib/encrypted_credentials.rb @@ -2,6 +2,7 @@ require "tempfile" require "openssl" require "base64" +require "pathname" module EncryptedCredentials class EncryptedFile