Public-Dockerfiles/webhook_application_dockerfile

40 lines
1.1 KiB
Text
Raw Normal View History

2024-12-18 17:36:21 +01:00
FROM alpine:3.20
ARG VERSION
LABEL version="${VERSION}" \
Maintainer="H2 invent GmbH" \
Description="Webhook Server" \
org.opencontainers.version="${VERSION}" \
org.opencontainers.image.title="Webhook Server" \
org.opencontainers.image.vendor="H2 invent GmbH" \
org.opencontainers.image.authors="Andreas Holzmann <support@h2-invent.com>" \
org.opencontainers.image.documentation="https://h2-invent.com" \
org.opencontainers.image.url="https://h2-invent.com"
RUN apk --no-cache add \
git \
curl \
jq \
&& rm -rf /var/cache/apk/*
RUN addgroup -S webhook \
&& adduser -S webhook -G webhook
WORKDIR /opt/webhook
RUN wget https://github.com/adnanh/webhook/releases/download/${VERSION}/webhook-linux-amd64.tar.gz -O artifact.tar.gz \
&& tar --strip-components=1 -xvzf artifact.tar.gz \
2024-12-18 17:45:30 +01:00
&& rm artifact.tar.gz
2024-12-18 17:36:21 +01:00
RUN echo "- id: whoami-webhook" > hooks.yaml \
&& echo " execute-command: 'whoami'" >> hooks.yaml
2024-12-19 11:05:04 +01:00
USER webhook
2024-12-18 17:36:21 +01:00
EXPOSE 9000
2024-12-19 11:05:04 +01:00
HEALTHCHECK --timeout=4s CMD curl --silent --fail http://127.0.0.1:9000/ || exit 1
2024-12-18 17:36:21 +01:00
2024-12-19 10:58:27 +01:00
CMD [ "./webhook", "-hooks", "hooks.yaml", "-verbose" ]