FROM --platform=$BUILDPLATFORM alpine:3.19
LABEL maintainer="contact@twhelp.app"

ARG TARGETOS="linux"
ARG TARGETARCH="amd64"
ARG CI_COMMIT_TAG="v3.0.0"

RUN apk --no-cache add ca-certificates tzdata wget && \
    wget --progress=dot:giga -O /usr/bin/twhelp https://gitea.dwysokinski.me/twhelp/corev3/releases/download/${CI_COMMIT_TAG}/corev3_${CI_COMMIT_TAG##v}_${TARGETOS}_${TARGETARCH} && \
    chmod +x /usr/bin/twhelp

EXPOSE 9234/tcp

ENTRYPOINT ["twhelp"]
