-
-
Save carrfane/d4f7b75a5e534cd9c2ed4b50e032eff2 to your computer and use it in GitHub Desktop.
Serverless setting with custom dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM public.ecr.aws/lambda/ruby:3.2 | |
RUN yum install -y amazon-linux-extras | |
RUN amazon-linux-extras enable postgresql14 | |
RUN yum group install "Development Tools" -y | |
RUN yum install -y postgresql postgresql-devel | |
RUN gem update bundler | |
CMD "/bin/bash" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
source "https://rubygems.org" | |
git_source(:github) { |repo_name| "https://github.com/#{repo_name}" } | |
ruby "3.2.2" | |
gem "activerecord", "~> 7.1" | |
gem "activerecord-import", "~> 1.5" | |
gem "pg" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
service: use-docker-file | |
plugins: | |
- serverless-ruby-layer | |
custom: | |
rubyLayer: | |
use_docker: true | |
docker_file: Dockerfile | |
native_libs: | |
- /usr/lib64/libpq.so.5 | |
- /usr/lib64/libldap_r-2.4.so.2 | |
- /usr/lib64/liblber-2.4.so.2 | |
- /usr/lib64/libsasl2.so.3 | |
- /usr/lib64/libssl3.so | |
- /usr/lib64/libsmime3.so | |
- /usr/lib64/libnss3.so | |
provider: | |
name: aws | |
runtime: ruby3.2 | |
environment: | |
LD_PRELOAD: '/opt/lib/libnssutil3.so' | |
functions: | |
hello: | |
handler: handler.hello |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment