added entrypoint script
parent
784294aa04
commit
733c1cc151
|
|
@ -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"]
|
||||
|
|
@ -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
|
||||
Loading…
Reference in New Issue