This repository has been archived by the owner on Jul 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
19 additions
and
36 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,38 +1,31 @@ | ||
# TODO: mulstistage build | ||
FROM openfaas/of-watchdog:0.8.2 as watchdog | ||
|
||
FROM ruby:3.2.0-slim-buster | ||
|
||
COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog | ||
RUN chmod +x /usr/bin/fwatchdog | ||
|
||
RUN apt-get update &&\ | ||
apt-get install -qy --no-install-recommends build-essential | ||
|
||
RUN mkdir -p /home/app/function | ||
|
||
WORKDIR /home/app/function | ||
|
||
RUN addgroup --system app &&\ | ||
adduser --system --ingroup app app | ||
|
||
RUN chown app:app -R /home/app | ||
|
||
USER app | ||
FROM ruby:3.2.0-slim as base | ||
|
||
RUN adduser app | ||
WORKDIR /mnt | ||
RUN bundle config --local path vendor/bundle | ||
EXPOSE 8080 | ||
|
||
HEALTHCHECK --interval=2s CMD curl -f http://127.0.0.1:4567/healthcheck | ||
|
||
ENV fprocess="ruby index.rb" | ||
ENV fprocess="bundle exec ruby index.rb" | ||
ENV upstream_url="http://127.0.0.1:4567" | ||
ENV mode="http" | ||
ENV APP_ENV="production" | ||
|
||
CMD ["fwatchdog"] | ||
|
||
COPY function/Gemfile . | ||
FROM base as builder | ||
|
||
RUN apt-get update &&\ | ||
apt-get install -qy --no-install-recommends build-essential | ||
COPY function/Gemfile . | ||
RUN bundle install | ||
|
||
|
||
FROM openfaas/of-watchdog:0.8.2 as watchdog | ||
FROM base | ||
|
||
COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog | ||
RUN chmod +x /usr/bin/fwatchdog | ||
COPY --from=builder /mnt/ . | ||
COPY function . | ||
USER app |
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,4 +1,4 @@ | ||
source 'https://rubygems.org' | ||
|
||
gem "sinatra", "~> 3" | ||
gem "sinatra", "~> 3.0" | ||
gem "falcon", "~> 0.42" |
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,6 +1,6 @@ | ||
require "sinatra" | ||
|
||
require_relative "handler" | ||
require_relative "lib/handler" | ||
|
||
handler = Handler.new | ||
|
||
|
File renamed without changes.