added entrypoint script

main
Andre Challier 2024-03-27 14:10:31 +01:00
parent 784294aa04
commit 733c1cc151
2 changed files with 30 additions and 2 deletions

View File

@ -4,7 +4,7 @@ COPY hooks.json.example /etc/webhook/hooks.json
FROM alpine:latest
RUN apk --no-cache add git openssh-client bash nano
COPY --from=build /usr/local/bin/webhook /usr/local/bin/webhook
COPY entrypoint.sh /etc/webhook/entrypoint.sh
WORKDIR /etc/webhook
EXPOSE 9000
ENTRYPOINT ["/usr/local/bin/webhook"]
CMD ["-verbose", "-hooks=/etc/webhook/hooks.json", "-hotreload"]
ENTRYPOINT ["/etc/webhook/entrypoint.sh"]

View File

@ -0,0 +1,28 @@
#!/bin/bash
#
# Create hosts.json with by replacing environment variables in template file
#
# Define the template file path
template_file="/etc/webhook/hook.json.tmpl"
# Define the output file path
output_file="/etc/webhook/hook.json"
# Check if the template file exists
if [ ! -f "$template_file" ]; then
echo "Template file $template_file not found."
exit 1
fi
envsubst < "$template_file" > "$output_file"
echo "Generated $output_file"
#
# Start webhooks
#
echo "Starting webhooks service"
exec /usr/local/bin/webhook -verbose -hooks=/etc/webhook/hooks.json -hotreload