diff --git a/webhook_application_dockerfile b/webhook_application_dockerfile new file mode 100644 index 0000000..71c3e51 --- /dev/null +++ b/webhook_application_dockerfile @@ -0,0 +1,38 @@ +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 " \ + 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 \ + && chmod +x webhook \ + rm artifact.tar.gz + +RUN echo "- id: whoami-webhook" > hooks.yaml \ + && echo " execute-command: 'whoami'" >> hooks.yaml + +EXPOSE 9000 + +USER webhook + +ENTRYPOINT ['/opt/webhook/webhook', '-hooks', 'hooks.yaml', '-verbose' ]