Removed unused template
This commit is contained in:
parent
4af99590ed
commit
f067d97095
@ -1,33 +0,0 @@
|
|||||||
FROM --platform=${TARGETPLATFORM:-linux/amd64} ghcr.io/openfaas/of-watchdog:0.9.10 as watchdog
|
|
||||||
FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine as build
|
|
||||||
|
|
||||||
RUN apk update && apk upgrade
|
|
||||||
RUN apk add crystal shards
|
|
||||||
RUN apk cache clean
|
|
||||||
WORKDIR /home/app
|
|
||||||
COPY . .
|
|
||||||
|
|
||||||
COPY function/shard.yml shard.yml
|
|
||||||
RUN shards install
|
|
||||||
RUN crystal build main.cr -o handler --release --static
|
|
||||||
RUN strip handler
|
|
||||||
|
|
||||||
FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine as ship
|
|
||||||
RUN apk update && apk upgrade && apk cache clean
|
|
||||||
# Add non root user
|
|
||||||
# Add non root user
|
|
||||||
RUN addgroup -S app && adduser app -S -G app
|
|
||||||
|
|
||||||
WORKDIR /home/app
|
|
||||||
USER app
|
|
||||||
|
|
||||||
COPY --from=build /home/app/function/ .
|
|
||||||
COPY --from=build /home/app/handler .
|
|
||||||
COPY --from=watchdog /fwatchdog /home/app/fwatchdog
|
|
||||||
|
|
||||||
ENV fprocess="./handler"
|
|
||||||
EXPOSE 8080
|
|
||||||
|
|
||||||
HEALTHCHECK --interval=2s CMD [ -e /tmp/.lock ] || exit 1
|
|
||||||
|
|
||||||
CMD ["./fwatchdog"]
|
|
@ -1,7 +0,0 @@
|
|||||||
require "json"
|
|
||||||
|
|
||||||
class Handler
|
|
||||||
def run(req : String)
|
|
||||||
return JSON::Any.new("Hello, Crystal. You said: #{req}")
|
|
||||||
end
|
|
||||||
end
|
|
@ -1,7 +0,0 @@
|
|||||||
name: crystal_faas_function
|
|
||||||
version: 0.1.0
|
|
||||||
|
|
||||||
# dependencies:
|
|
||||||
# pg:
|
|
||||||
# github: will/crystal-pg
|
|
||||||
# version: "~> 0.5"
|
|
@ -1,11 +0,0 @@
|
|||||||
# Copyright (c) Thomas Peikert 2018. All rights reserved.
|
|
||||||
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
||||||
|
|
||||||
require "json"
|
|
||||||
require "./function/handler"
|
|
||||||
|
|
||||||
req = STDIN.gets_to_end
|
|
||||||
handler = Handler.new
|
|
||||||
res = handler.run req
|
|
||||||
|
|
||||||
puts res
|
|
@ -1,6 +0,0 @@
|
|||||||
language: crystal
|
|
||||||
fprocess: ./handler
|
|
||||||
welcome_message: |
|
|
||||||
You have created a new function which uses crystal 1.7.3 🎉
|
|
||||||
To include third-party dependencies, use a vendoring tool like shards:
|
|
||||||
shards documentation: https://github.com/crystal-lang/shards
|
|
Loading…
Reference in New Issue
Block a user