Not going to reimplement tapas in crystal

This commit is contained in:
Roberto Alsina 2023-06-01 20:11:40 -03:00
parent ad164ac7f2
commit 0e5a41c170
4 changed files with 2 additions and 19 deletions

View File

@ -15,7 +15,3 @@ functions:
lang: python3-flask lang: python3-flask
handler: ./tapas handler: ./tapas
image: ralsina/tapas:latest image: ralsina/tapas:latest
tapas2:
lang: crystal
handler: ./tapas2
image: ralsina/tapas2:latest

View File

@ -1,7 +0,0 @@
require "json"
class Handler
def run(req : String)
return JSON::Any.new("Hello, Crystal. You said: #{req}")
end
end

View File

@ -1,7 +0,0 @@
name: crystal_faas_function
version: 0.1.0
# dependencies:
# pg:
# github: will/crystal-pg
# version: "~> 0.5"

View File

@ -1,7 +1,7 @@
FROM --platform=${TARGETPLATFORM:-linux/amd64} ghcr.io/openfaas/of-watchdog:0.9.10 as watchdog FROM --platform=${TARGETPLATFORM:-linux/amd64} ghcr.io/openfaas/of-watchdog:0.9.10 as watchdog
FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine as build FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine as build
RUN apk update && apk upgrade
RUN apk add crystal shards RUN apk add crystal shards
WORKDIR /home/app WORKDIR /home/app
COPY . . COPY . .
@ -12,6 +12,7 @@ RUN crystal build main.cr -o handler --release --static
RUN strip handler RUN strip handler
FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine as ship FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine as ship
RUN apk update && apk upgrade
# Add non root user # Add non root user
# Add non root user # Add non root user
RUN addgroup -S app && adduser app -S -G app RUN addgroup -S app && adduser app -S -G app