2024-06-29 23:25:42 +00:00
|
|
|
FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine as build
|
2024-06-30 13:18:51 +00:00
|
|
|
RUN apk add crystal shards yaml-dev openssl-dev zlib-dev libxml2-dev
|
2024-06-29 23:25:42 +00:00
|
|
|
RUN addgroup -S app && adduser app -S -G app
|
|
|
|
WORKDIR /home/app
|
|
|
|
COPY shard.yml ./
|
|
|
|
RUN mkdir src/
|
|
|
|
COPY src/* src/
|
|
|
|
RUN shards install
|
2024-06-29 23:38:34 +00:00
|
|
|
RUN shards build -d --error-trace
|
2024-06-30 16:11:35 +00:00
|
|
|
RUN strip bin/*
|
2024-06-29 23:25:42 +00:00
|
|
|
|
|
|
|
FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine as ship
|
2024-06-30 13:18:51 +00:00
|
|
|
RUN apk add tinyproxy multirun openssl zlib yaml pcre2 gc libevent libgcc libxml2
|
2024-06-29 23:25:42 +00:00
|
|
|
|
|
|
|
# Unprivileged user
|
|
|
|
RUN addgroup -S app && adduser app -S -G app
|
|
|
|
WORKDIR /home/app
|
|
|
|
|
2024-06-30 18:10:49 +00:00
|
|
|
RUN mkdir runtimes
|
|
|
|
COPY runtimes/* ./runtimes/
|
2024-06-29 23:38:34 +00:00
|
|
|
COPY tinyproxy.conf ./
|
2024-06-30 16:11:35 +00:00
|
|
|
COPY --from=build /home/app/bin/faaso-daemon /home/app/bin/faaso /usr/bin/
|
2024-06-29 23:25:42 +00:00
|
|
|
|
2024-06-30 16:11:35 +00:00
|
|
|
CMD ["/usr/bin/multirun", "faaso-daemon", "tinyproxy -d -c tinyproxy.conf"]
|