faaso/templates/crystal/Dockerfile

21 lines
532 B
Docker
Raw Normal View History

FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine as build
2024-06-28 20:16:20 +00:00
RUN apk update && apk upgrade && apk add crystal shards openssl-dev zlib-dev && apk cache clean
WORKDIR /home/app
2024-06-28 20:16:20 +00:00
COPY shard.yml *.cr .
RUN shards install
2024-06-28 20:16:20 +00:00
RUN shards build
FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine as ship
2024-06-28 20:16:20 +00:00
RUN apk update && apk upgrade && apk add openssl pcre2 libgcc gc libevent && apk cache clean
RUN addgroup -S app && adduser app -S -G app
WORKDIR /home/app
USER app
2024-06-28 20:16:20 +00:00
COPY --from=build /home/app/bin/function .
2024-06-28 20:16:20 +00:00
CMD ["./function"]