mirror of
https://github.com/bitnami/containers.git
synced 2026-03-09 15:40:15 +08:00
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:
@@ -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"]
|
||||
|
||||
7
bitnami/tomcat/bitnami-utils-custom.sh
Normal file
7
bitnami/tomcat/bitnami-utils-custom.sh
Normal 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/
|
||||
}
|
||||
@@ -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 "$@"
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user