Commit 020776e5 authored by Paul Desplanque's avatar Paul Desplanque

Mount web_static_* volumes while starting

parent b457d2e7
...@@ -30,6 +30,12 @@ echo APACHE_LOGS_DIR="$APACHE_LOGS_DIR" >> "$APP_VARFILE" ...@@ -30,6 +30,12 @@ echo APACHE_LOGS_DIR="$APACHE_LOGS_DIR" >> "$APP_VARFILE"
echo CERTBOT_LOGS_DIR="$CERTBOT_LOGS_DIR" >> "$APP_VARFILE" echo CERTBOT_LOGS_DIR="$CERTBOT_LOGS_DIR" >> "$APP_VARFILE"
echo STATIC_DIR="$STATIC_DIR" >> "$APP_VARFILE" echo STATIC_DIR="$STATIC_DIR" >> "$APP_VARFILE"
volumes=($(docker volume ls -q | grep ^web_static_ | cut -d_ -f3))
mountCommand=''
for name in ${volumes[@]}; do
mountCommand="$mountCommand -v web_static_$name:/var/www/static_$name:ro"
done
docker run -d --restart on-failure \ docker run -d --restart on-failure \
--name $APP_NAME \ --name $APP_NAME \
-e CONTAINER_NAME=$APP_NAME \ -e CONTAINER_NAME=$APP_NAME \
...@@ -38,6 +44,7 @@ docker run -d --restart on-failure \ ...@@ -38,6 +44,7 @@ docker run -d --restart on-failure \
-v "$APACHE_LOGS_DIR":/var/log/apache2 \ -v "$APACHE_LOGS_DIR":/var/log/apache2 \
-v "$CERTBOT_LOGS_DIR":/var/log/letsencrypt \ -v "$CERTBOT_LOGS_DIR":/var/log/letsencrypt \
-v "$STATIC_DIR":/var/www/static:ro \ -v "$STATIC_DIR":/var/www/static:ro \
$mountCommand \
-p 80:80 -p 443:443 \ -p 80:80 -p 443:443 \
$APP_NAME:latest bash -c \ $APP_NAME:latest bash -c \
"cron && "cron &&
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment