-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
30 lines (23 loc) · 1.17 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#*********************************************************************
# Copyright 2021 Regents of the University of California
# All rights reserved
#*********************************************************************
# This image is based on an architecture that matches the Lambda Ruby runtime
# docker build -t ${ECR_REGISTRY}/mysql-ruby-lambda .
FROM public.ecr.aws/lambda/ruby:3.2
RUN yum -y update && yum -y upgrade
# Install an os-specific MySQL installation.
# gcc and make are required to build mysql.
# UC3 ruby code pulls a common gem from github for use in Lambda code.
RUN yum -y install mysql-devel gcc make git
RUN gem update bundler
# Start with a Gemfile containing only MySQL
COPY * ./
RUN bundle config --local build.mysql2 --with-mysql2-config=/usr/lib64/mysql/mysql_config && \
bundle config --local silence_root_warning true && \
bundle config set path 'vendor/bundle' && \
bundle install
# This structure assumes the following:
# lambda_function.rb contains a module name LambdaFunctions which contains a class Handler
# That class conforms to the method signature expected for a Lambda.
CMD [ "lambda_function.LambdaFunctions::Handler.process" ]