From 0e5a41c17091cf70d3b92bade641798d53ac3e7f Mon Sep 17 00:00:00 2001 From: Roberto Alsina Date: Thu, 1 Jun 2023 20:11:40 -0300 Subject: [PATCH] Not going to reimplement tapas in crystal --- functions.yml | 4 ---- tapas2/handler.cr | 7 ------- tapas2/shard.yml | 7 ------- template/crystal/Dockerfile | 3 ++- 4 files changed, 2 insertions(+), 19 deletions(-) delete mode 100644 tapas2/handler.cr delete mode 100644 tapas2/shard.yml diff --git a/functions.yml b/functions.yml index 90314e9..18bb806 100644 --- a/functions.yml +++ b/functions.yml @@ -15,7 +15,3 @@ functions: lang: python3-flask handler: ./tapas image: ralsina/tapas:latest - tapas2: - lang: crystal - handler: ./tapas2 - image: ralsina/tapas2:latest diff --git a/tapas2/handler.cr b/tapas2/handler.cr deleted file mode 100644 index d8af919..0000000 --- a/tapas2/handler.cr +++ /dev/null @@ -1,7 +0,0 @@ -require "json" - -class Handler - def run(req : String) - return JSON::Any.new("Hello, Crystal. You said: #{req}") - end -end diff --git a/tapas2/shard.yml b/tapas2/shard.yml deleted file mode 100644 index 76711f4..0000000 --- a/tapas2/shard.yml +++ /dev/null @@ -1,7 +0,0 @@ -name: crystal_faas_function -version: 0.1.0 - -# dependencies: -# pg: -# github: will/crystal-pg -# version: "~> 0.5" diff --git a/template/crystal/Dockerfile b/template/crystal/Dockerfile index 6d41aaa..ebf1bf9 100644 --- a/template/crystal/Dockerfile +++ b/template/crystal/Dockerfile @@ -1,7 +1,7 @@ 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 WORKDIR /home/app COPY . . @@ -12,6 +12,7 @@ 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 # Add non root user # Add non root user RUN addgroup -S app && adduser app -S -G app