-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
36 lines (23 loc) · 1.02 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
31
32
33
34
35
36
#syntax=docker/dockerfile:1.2
ARG DEBIAN_VERSION=buster
ARG RUBY_VERSION=3.0
FROM public.ecr.aws/exapico/lambda-ruby-builder:${DEBIAN_VERSION}-${RUBY_VERSION} as builder
RUN apt-get update -qq && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends libmariadb-dev && \
find /var/lib/apt/lists -type f -delete
RUN bundle config set --local deployment true && \
bundle config set --local path vendor/bundle && \
bundle config set --local without development:test
COPY Gemfile Gemfile.lock ./
ENV BUNDLE_GLOBAL_GEM_CACHE=true \
BUNDLE_USER_CACHE=/cache/bundler \
BUNDLE_CLEAN=true
RUN --mount=type=cache,target=/cache/bundler \
MAKEFLAGS=-j$(nproc) bundle install --verbose
FROM public.ecr.aws/exapico/lambda-ruby:${DEBIAN_VERSION}-${RUBY_VERSION}
RUN apt-get update -qq && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends libmariadb3 && \
find /var/lib/apt/lists -type f -delete
COPY ./ ./
COPY --from=builder /var/task/ ./
CMD ["handler.main"]