faaso/Dockerfile

28 lines
894 B
Docker
Raw Normal View History

FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine as build
RUN apk update && apk add crystal shards yaml-dev openssl-dev zlib-dev libxml2-dev && apk cache clean
RUN addgroup -S app && adduser app -S -G app
WORKDIR /home/app
COPY shard.yml ./
RUN mkdir src/
2024-07-02 14:27:27 +00:00
COPY src/ src/
2024-07-05 15:04:36 +00:00
COPY runtimes/ runtimes/
RUN shards install
2024-06-29 23:38:34 +00:00
RUN shards build -d --error-trace
2024-07-05 15:04:36 +00:00
# RUN strip bin/*
FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine as ship
2024-07-04 23:23:07 +00:00
RUN apk update && apk add caddy nss-tools multirun docker openssl zlib yaml pcre2 gc libevent libgcc libxml2 ttyd && apk cache clean
# Unprivileged user
RUN addgroup -S app && adduser app -S -G app
WORKDIR /home/app
2024-07-02 14:27:27 +00:00
RUN mkdir runtimes public
COPY public/ public/
COPY Caddyfile ./
2024-06-30 16:11:35 +00:00
COPY --from=build /home/app/bin/faaso-daemon /home/app/bin/faaso /usr/bin/
2024-07-01 12:48:29 +00:00
RUN mkdir /secrets
CMD ["/usr/bin/multirun", "-v", "faaso-daemon", "caddy run --config Caddyfile"]