![install haproxy on alpine install haproxy on alpine](https://www.sysnet-admin.com/wp-content/uploads/2021/03/image-4-1024x456.png)
echo "Watching directory: $LIVE_CERT_FOLDER "
#Install haproxy on alpine install
When changes are detected, install # combined certificates and reload HAproxy. IGNORE_UNTIL = " $( date +%s ) " # Watch the live certificates directory. if ] thenĮcho "Already watching directory: $LIVE_CERT_FOLDER " >&2įi # Debounce for 60 seconds, which we assume is enough time to create or renew # all certifies and avoid multiple restarts.
![install haproxy on alpine install haproxy on alpine](https://miro.medium.com/max/1400/1*GofFltLB2E6_FRlRFZWXuQ.png)
#!/bin/bash # See: set -e mkdir -p " $LIVE_CERT_FOLDER " # Abort, if already running. So on this script we are actually validating if we already the certificate file present otherwise, If we don’t we will first be creating a self-signed certificate to use so that haproxy won’t complain on its entrypoint and finds out that the file we are passing its non-existant. if ] thenĬat " $DIR /privkey.pem" " $DIR /fullchain.pem" > /certs/cert.pem Openssl req -new -key cert.key -out cert.csr -nodes -subj "/C=US/ST=CA/L=SF/O=ilhicas/OU=ilhicas x509 -req -days 365 -in cert.csr -signkey cert.key -out cert.crtįi # Install combined certificates for HAproxy. Mkdir -p " $LIVE_CERT_FOLDER " # Create a self signed default certificate, so HAproxy can start before we have # any real certificates.