Add CNAME option

When a repo have a CNAME file, it will use the URL on it to map the server_name on ngnix
This commit is contained in:
Arthur Neves committed 2014-08-14 14:43:35 -04:00
1 parent 8760c94143
commit 0cd1839ce8
2 files changed
+10

No files matched your search

+6
View File
@@ -63,6 +63,12 @@ case "$1" in
docker inspect $oldid &> /dev/null && docker kill $oldid > /dev/null docker inspect $oldid &> /dev/null && docker kill $oldid > /dev/null
fi fi
# CNAME
CNAME=$(docker run -i $IMAGE /bin/bash -c "if [[ -f /app/CNAME ]];then cat /app/CNAME; fi")
if [[ -n "$CNAME" ]]; then
echo "$CNAME" > "$DOKKU_ROOT/$APP/CNAME"
fi
# start the app # start the app
DOCKER_ARGS=$(: | pluginhook docker-args $APP) DOCKER_ARGS=$(: | pluginhook docker-args $APP)
id=$(docker run -d -p 5000 -e PORT=5000 $DOCKER_ARGS $IMAGE /bin/bash -c "/start web") id=$(docker run -d -p 5000 -e PORT=5000 $DOCKER_ARGS $IMAGE /bin/bash -c "/start web")
+4
View File
@@ -25,6 +25,10 @@ EOF
SSL_DIRECTIVES="" SSL_DIRECTIVES=""
fi fi
if [[ -f "$DOKKU_ROOT/$APP/CNAME" ]]; then
hostname=$(< "$DOKKU_ROOT/$APP/CNAME" )
fi
# ssl based nginx.conf # ssl based nginx.conf
if [[ -n "$SSL_INUSE" ]]; then if [[ -n "$SSL_INUSE" ]]; then
cat<<EOF > $DOKKU_ROOT/$APP/nginx.conf cat<<EOF > $DOKKU_ROOT/$APP/nginx.conf