# syntax=docker/dockerfile:1
# Packages the binary deploy/build.sh already built (dist/bin/linux_<arch>/beach), so no
# emulation is needed. Build it with:  sh deploy/build.sh && docker buildx build .
#
# Beach runs as root in the container: to start and stop containers it must read the
# Docker socket, and the socket's group id differs from host to host. smartmontools is
# there for the optional "smartctl" source (it also needs the devices passed in).
FROM alpine:3.22
ARG TARGETARCH
LABEL org.opencontainers.image.title="Beach" \
      org.opencontainers.image.description="One-page control panel for a homelab: containers, pools, disks and tunnels" \
      org.opencontainers.image.source="https://git.veillax.com/Veillax/beach" \
      org.opencontainers.image.licenses="MIT"
RUN apk add --no-cache ca-certificates smartmontools \
 && mkdir /data
COPY dist/bin/linux_${TARGETARCH}/beach /beach
VOLUME ["/data"]
EXPOSE 8095
ENTRYPOINT ["/beach"]
CMD ["-listen", ":8095", "-data", "/data/beach.db"]
