add letsencrypt stuff

This commit is contained in:
2020-07-08 13:01:03 +00:00
parent 48b0afefa9
commit 285505c7ac
3 changed files with 19 additions and 0 deletions

View File

@ -1,8 +1,18 @@
#!/bin/bash
CONTAINER_NAME="httpdispatcher"
IMAGE_NAME="wollud1969/httpdispatcher"
VERSION="latest"
VOLUME_CONFIG=httpd-config
VOLUME_LOGS=httpd-logs
docker volume inspect $VOLUME_CONFIG > /dev/null || docker volume create $VOLUME_CONFIG
docker volume inspect $VOLUME_LOGS > /dev/null || docker volume create $VOLUME_LOGS
if [ "$MAINADDR" = "" ]; then
MAINDEV=`ip route list match default | sed -e 's/^default.*dev \(\S\+\)\( \S\+\)\? \?$/\1/'`
MAINADDR=`ip addr list dev $MAINDEV | awk '/inet / {print $2}' | awk -F/ '{print $1}'`
@ -12,6 +22,8 @@ docker run \
-d \
-p 80:80 \
-p 443:443 \
-v $VOLUME_CONFIG:/usr/local/apache2/conf/editable \
-v $VOLUME_LOGS:/usr/local/apache2/logs \
--add-host servicehost:$MAINADDR \
--name $CONTAINER_NAME \
--restart always \