faaso/Dockerfile

49 lines
1.0 KiB
Docker
Raw Normal View History

2024-07-09 01:34:27 +00:00
FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine:3.20 AS build
RUN apk add --no-cache \
crystal \
shards \
yaml-dev \
openssl-dev \
zlib-dev \
libxml2-dev \
make
RUN rm -rf /var/cache/apk/*
RUN addgroup -S app && adduser app -S -G app
WORKDIR /home/app
COPY shard.yml Makefile ./
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 make
2024-07-05 15:04:36 +00:00
# RUN strip bin/*
2024-07-09 01:34:27 +00:00
FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine:3.20 AS ship
RUN apk add --no-cache \
caddy \
nss-tools \
multirun \
docker \
openssl \
zlib \
yaml \
pcre2 \
gc \
libevent \
libgcc \
libxml2 \
ttyd
RUN rm -rf /var/cache/apk/*
# Unprivileged user
RUN addgroup -S app && adduser app -S -G app
WORKDIR /home/app
2024-07-05 16:25:40 +00:00
RUN mkdir /home/app/tmp && chown app /home/app/tmp
2024-07-02 14:27:27 +00:00
COPY public/ public/
2024-06-30 16:11:35 +00:00
COPY --from=build /home/app/bin/faaso-daemon /home/app/bin/faaso /usr/bin/
2024-07-06 14:57:30 +00:00
# Mount points for persistent data
2024-07-09 01:34:27 +00:00
RUN mkdir /secrets /config
2024-07-01 12:48:29 +00:00
2024-07-06 14:57:30 +00:00
CMD ["/usr/bin/multirun", "-v", "faaso-daemon", "caddy run --config config/Caddyfile"]