-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix nat instance health checker (#83)
- Loading branch information
Showing
6 changed files
with
20 additions
and
59 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
terraform 1.8.2 | ||
ruby 3.3.1 | ||
ruby 3.3.5 |
49 changes: 16 additions & 33 deletions
49
infrastructure/somleng/modules/nat_instance/health_checker/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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,31 @@ | ||
ARG FUNCTION_DIR="/function" | ||
ARG RUBY_VERSION=3.3 | ||
FROM public.ecr.aws/docker/library/ruby:$RUBY_VERSION-alpine AS build-image | ||
|
||
RUN apk update && \ | ||
apk upgrade && \ | ||
apk add --update --no-cache build-base | ||
# syntax=docker/dockerfile:1.7-labs | ||
|
||
RUN gem install bundler | ||
ARG RUBY_VERSION=3.3 | ||
FROM public.ecr.aws/lambda/ruby:$RUBY_VERSION AS build-image | ||
|
||
ARG FUNCTION_DIR | ||
RUN mkdir -p ${FUNCTION_DIR} | ||
COPY Gemfile Gemfile.lock ${FUNCTION_DIR}/ | ||
WORKDIR ${FUNCTION_DIR} | ||
RUN dnf update && \ | ||
dnf -y install gcc make | ||
|
||
ENV BUNDLE_APP_CONFIG="${FUNCTION_DIR}/.bundle" | ||
COPY Gemfile Gemfile.lock ${LAMBDA_TASK_ROOT}/ | ||
|
||
RUN bundle config --local deployment true && \ | ||
RUN gem install bundler && \ | ||
bundle config --local deployment true && \ | ||
bundle config --local path "vendor/bundle" && \ | ||
bundle config --local without 'development test' | ||
|
||
RUN bundle install --jobs 20 --retry 5 | ||
bundle config --local without 'development test' && \ | ||
bundle install | ||
|
||
RUN rm -rf vendor/bundle/ruby/*/cache/ && find vendor/ -name "*.o" -delete && find vendor/ -name "*.c" | ||
|
||
COPY app.rb ${FUNCTION_DIR} | ||
COPY app/ ${FUNCTION_DIR}/app/ | ||
COPY config/ ${FUNCTION_DIR}/config/ | ||
|
||
############################# | ||
|
||
FROM public.ecr.aws/docker/library/ruby:$RUBY_VERSION-alpine | ||
COPY app.rb ${LAMBDA_TASK_ROOT}/ | ||
COPY app/ ${LAMBDA_TASK_ROOT}/app/ | ||
COPY --exclude=*.key config/ ${LAMBDA_TASK_ROOT}/config/ | ||
|
||
ARG FUNCTION_DIR | ||
WORKDIR ${FUNCTION_DIR} | ||
# ############################# | ||
|
||
ENV BUNDLE_APP_CONFIG="${FUNCTION_DIR}/.bundle" | ||
COPY --from=build-image ${FUNCTION_DIR} ${FUNCTION_DIR} | ||
FROM public.ecr.aws/lambda/ruby:$RUBY_VERSION | ||
|
||
RUN apk update && \ | ||
apk upgrade && \ | ||
gem install bundler && \ | ||
gem install aws_lambda_ric | ||
COPY --from=build-image ${LAMBDA_TASK_ROOT} ${LAMBDA_TASK_ROOT} | ||
|
||
ENV RUBY_YJIT_ENABLE=true | ||
|
||
ENTRYPOINT [ "/usr/local/bundle/bin/aws_lambda_ric" ] | ||
CMD [ "app.App::Handler.process" ] |
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
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
4 changes: 2 additions & 2 deletions
4
infrastructure/somleng/modules/nat_instance/health_checker/config/application.rb
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
Dir["#{File.dirname(__FILE__)}/**/*.rb"].sort.each { |f| require f } | ||
Dir["#{File.dirname(__FILE__)}/../app/**/*.rb"].sort.each { |f| require f } | ||
Dir["#{File.dirname(__FILE__)}/**/*.rb"].each { |f| require f } | ||
Dir["#{File.dirname(__FILE__)}/../app/**/*.rb"].each { |f| require f } |
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