Skip demo data on startup

pull/9/head
Jakob Miksch 2022-09-05 15:52:15 +02:00
parent 7bc3b1f037
commit d5dbd403d5
3 changed files with 21 additions and 10 deletions

View File

@ -30,6 +30,7 @@ ENV STABLE_EXTENSIONS=''
ENV STABLE_PLUGIN_URL=$STABLE_PLUGIN_URL ENV STABLE_PLUGIN_URL=$STABLE_PLUGIN_URL
ENV ADDITIONAL_LIBS_DIR=/opt/additional_libs/ ENV ADDITIONAL_LIBS_DIR=/opt/additional_libs/
ENV ADDITIONAL_FONTS_DIR=/opt/additional_fonts/ ENV ADDITIONAL_FONTS_DIR=/opt/additional_fonts/
ENV SKIP_DEMO_DATA=false
# see https://docs.geoserver.org/stable/en/user/production/container.html # see https://docs.geoserver.org/stable/en/user/production/container.html
ENV CATALINA_OPTS="\$EXTRA_JAVA_OPTS \ ENV CATALINA_OPTS="\$EXTRA_JAVA_OPTS \

View File

@ -54,6 +54,11 @@ docker run -it -p 80:8080 \
An empty data directory will be populated on first use. You can easily update GeoServer while An empty data directory will be populated on first use. You can easily update GeoServer while
using the same data directory. using the same data directory.
### How to start a GeoServer without sample data?
This image populates GeoServer with demo data by default. For production scenarios this is typically not desired.
Setting the environment varibale `SKIP_DEMO_DATA` can be set to `true` to create an empty GeoServer.
### How to download and install additional extensions on startup? ### How to download and install additional extensions on startup?
The ``startup.sh`` script allows some customization on startup: The ``startup.sh`` script allows some customization on startup:

View File

@ -1,10 +1,15 @@
#!/bin/sh #!/bin/sh
echo "Welcome to GeoServer $GEOSERVER_VERSION" echo "Welcome to GeoServer $GEOSERVER_VERSION"
## Skip demo data
if [ "${SKIP_DEMO_DATA}" = "true" ]; then
unset GEOSERVER_REQUIRE_FILE
fi
## install release data directory if needed before starting tomcat ## install release data directory if needed before starting tomcat
if [ ! -f "$GEOSERVER_REQUIRE_FILE" ]; then if [ ! -z "$GEOSERVER_REQUIRE_FILE" ] && [ ! -f "$GEOSERVER_REQUIRE_FILE" ]; then
echo "Initialize $GEOSERVER_DATA_DIR from data directory included in geoserver.war" echo "Initialize $GEOSERVER_DATA_DIR from data directory included in geoserver.war"
cp -r $CATALINA_HOME/webapps/geoserver/data/* $GEOSERVER_DATA_DIR cp -r $CATALINA_HOME/webapps/geoserver/data/* $GEOSERVER_DATA_DIR
fi fi
## install GeoServer extensions before starting the tomcat ## install GeoServer extensions before starting the tomcat