Skip to content

Instantly share code, notes, and snippets.

@adminph-de
Last active November 16, 2020 13:24
Show Gist options
  • Save adminph-de/8a84af6acd3749cb626cd1dd62acdf1c to your computer and use it in GitHub Desktop.
Save adminph-de/8a84af6acd3749cb626cd1dd62acdf1c to your computer and use it in GitHub Desktop.
Deploy Apache2 http-probe on CentOS
#!/bin/bash
# Simple deployment script to run the Apache2 http-probe on port 8080/tcp
# Helpfull if you need a hearbeat of the server (Loabalancer, etc.)
# without installing Apache2 natively.
#
# Check my Git for more details:
# - https://github.com/adminph-de/docker-apache2-http-probe
#
# Check the pre- build Docker Container:
# - https://hub.docker.com/r/codesnipes/apache2-http-probe
#
# Deploy/Install:
# $ sudo curl -fsSL [UseTheRawLinkToTheFile] | bash -s --
unset probe
sudo yum -y install git
if [ ! -d ~/docker-apache2-http-probe ]; then
cd ~/
git clone https://github.com/adminph-de/docker-apache2-http-probe.git
cd ~/docker-apache2-http-probe
docker build -t http-probe:latest .
docker container run --name http-probe -d --restart always -p 8080:80 http-probe:latest
else
probe=`docker container ls | grep http-probe:latest | awk '{ print $1 }'`
cd ~/docker-apache2-http-probe
git pull
docker build -t http-probe:latest .
if [ ! -z ${probe+x} ]; then
echo "Removing running http-probe container: '$probe'";
docker container rm -f $probe
fi
echo "Starting http-probe container....."
docker container run --name http-probe -d --restart always -p 8080:80 http-probe:latest
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment