replaced /app volume with $BITNAMI_APP_VOL_PREFIX/webapps volume

Users can drop the `.war` files of their applications into this
directory and Tomcat will automatically pick them up.
This commit is contained in:
Sameer Naik
2015-08-12 23:40:07 +05:30
parent 249f4983aa
commit 41ea1e582b
6 changed files with 21 additions and 5 deletions

View File

@@ -12,8 +12,9 @@ ENV BITNAMI_APP_VOL_PREFIX=/bitnami/$BITNAMI_APP_NAME \
RUN sh $BITNAMI_PREFIX/install.sh\
--tomcat_manager_username manager
COPY bitnami-utils-custom.sh /bitnami-utils-custom.sh
EXPOSE 8080
VOLUME ["$BITNAMI_APP_VOL_PREFIX/conf", "$BITNAMI_APP_VOL_PREFIX/logs", "/app"]
VOLUME ["$BITNAMI_APP_VOL_PREFIX/conf", "$BITNAMI_APP_VOL_PREFIX/logs", "$BITNAMI_APP_VOL_PREFIX/webapps"]
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

View File

@@ -0,0 +1,7 @@
# Tomcat Utility functions
initialize_tomcat_webapps() {
echo "==> Initializing Tomcat webapps..."
echo ""
cp -a $BITNAMI_APP_DIR/webapps.defaults/* $BITNAMI_APP_DIR/webapps/
}

View File

@@ -23,10 +23,15 @@ else
print_container_already_initialized $BITNAMI_APP_NAME
fi
chown -R $BITNAMI_APP_USER:$BITNAMI_APP_USER $BITNAMI_APP_VOL_PREFIX/conf/ $BITNAMI_APP_VOL_PREFIX/logs/ /app/ || true
chown -R $BITNAMI_APP_USER:$BITNAMI_APP_USER $BITNAMI_APP_VOL_PREFIX/conf/ $BITNAMI_APP_VOL_PREFIX/logs/ $BITNAMI_APP_VOL_PREFIX/webapps/ || true
if [ "$1" = 'catalina.sh' ]; then
set -- $@ $EXTRA_OPTIONS
if [ ! -d $BITNAMI_APP_VOL_PREFIX/webapps/manager ]; then
initialize_tomcat_webapps
fi
exec gosu $BITNAMI_APP_USER "$@"
else
exec "$@"

View File

@@ -4,7 +4,7 @@
TOMCAT_PASSWORD: Password set at first boot for your $BITNAMI_APP_NAME server (default: none).
VOLUMES:
/app: Location of your $BITNAMI_APP_NAME application to be served.
$BITNAMI_APP_VOL_PREFIX/webapps: Location of your $BITNAMI_APP_NAME webapps.
$BITNAMI_APP_VOL_PREFIX/conf: Location of $BITNAMI_APP_NAME config files.
$BITNAMI_APP_VOL_PREFIX/logs: Location of $BITNAMI_APP_NAME logs.

View File

@@ -1,7 +1,7 @@
environment_variables:
TOMCAT_PASSWORD: "Password set at first boot for your $BITNAMI_APP_NAME server (default: none)."
volumes:
/app: "Location of your $BITNAMI_APP_NAME application to be served."
$BITNAMI_APP_VOL_PREFIX/webapps: "Location of your $BITNAMI_APP_NAME webapps."
$BITNAMI_APP_VOL_PREFIX/conf: "Location of $BITNAMI_APP_NAME config files."
$BITNAMI_APP_VOL_PREFIX/logs: "Location of $BITNAMI_APP_NAME logs."
ports:

View File

@@ -4,7 +4,10 @@ cd $BITNAMI_APP_DIR
# set up default config
mv conf conf.defaults
# set up webapps directory
mv webapps webapps.defaults
# symlink mount points at root to install dir
ln -s $BITNAMI_APP_DIR/webapps/app /app
ln -s $BITNAMI_APP_DIR/webapps $BITNAMI_APP_VOL_PREFIX/webapps
ln -s $BITNAMI_APP_DIR/conf $BITNAMI_APP_VOL_PREFIX/conf
ln -s $BITNAMI_APP_DIR/logs $BITNAMI_APP_VOL_PREFIX/logs