FROM alpine:3.21 AS base
RUN apk add --no-cache gettext

FROM base
COPY --from=dxflrs/garage:v2.2.0 /garage /garage
COPY garage.toml /etc/garage.toml.tpl

CMD envsubst '${RPC_SECRET} ${ARGENTO_NODE_ID} ${ADMIN_TOKEN}' < /etc/garage.toml.tpl > /etc/garage.toml && exec /garage server
