Add support to change tomcat default HTTP port
parent
d6a5e841ce
commit
1f39bfe152
|
|
@ -31,6 +31,7 @@ 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
|
ENV SKIP_DEMO_DATA=false
|
||||||
|
ENV TOMCAT_HTTP_PORT=8080
|
||||||
|
|
||||||
# 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 \
|
||||||
|
|
|
||||||
51
README.md
51
README.md
|
|
@ -2,20 +2,20 @@
|
||||||
|
|
||||||
This Dockerfile can be used to create images for all geoserver versions since 2.5.
|
This Dockerfile can be used to create images for all geoserver versions since 2.5.
|
||||||
|
|
||||||
* Debian based Linux
|
- Debian based Linux
|
||||||
* OpenJDK 11
|
- OpenJDK 11
|
||||||
* Tomcat 9
|
- Tomcat 9
|
||||||
* GeoServer
|
- GeoServer
|
||||||
* Support of custom fonts (e.g. for SLD styling)
|
- Support of custom fonts (e.g. for SLD styling)
|
||||||
* CORS support
|
- CORS support
|
||||||
* Support extensions
|
- Support extensions
|
||||||
* Support additional libraries
|
- Support additional libraries
|
||||||
|
|
||||||
## How to Use
|
## How to Use
|
||||||
|
|
||||||
### How to run official release?
|
### How to run official release?
|
||||||
|
|
||||||
To pull an official image use ``docker.osgeo.org/geoserver:{{VERSION}}``, e.g.:
|
To pull an official image use `docker.osgeo.org/geoserver:{{VERSION}}`, e.g.:
|
||||||
|
|
||||||
```
|
```
|
||||||
docker pull docker.osgeo.org/geoserver:2.21.1
|
docker pull docker.osgeo.org/geoserver:2.21.1
|
||||||
|
|
@ -36,7 +36,7 @@ docker run -d -p 80:8080 docker.osgeo.org/geoserver:2.21.1
|
||||||
Check http://localhost/geoserver to see the geoserver page,
|
Check http://localhost/geoserver to see the geoserver page,
|
||||||
and login with geoserver default `admin:geoserver` credentials.
|
and login with geoserver default `admin:geoserver` credentials.
|
||||||
|
|
||||||
**IMPORTANT NOTE:** Please change the default ``geoserver`` and ``master`` passwords.
|
**IMPORTANT NOTE:** Please change the default `geoserver` and `master` passwords.
|
||||||
|
|
||||||
For more information see the user-guide [docker installation instructions](https://docs.geoserver.org/latest/en/user/installation/docker.html).
|
For more information see the user-guide [docker installation instructions](https://docs.geoserver.org/latest/en/user/installation/docker.html).
|
||||||
|
|
||||||
|
|
@ -44,7 +44,6 @@ For more information see the user-guide [docker installation instructions](https
|
||||||
|
|
||||||
To use an external folder as your geoserver data directory.
|
To use an external folder as your geoserver data directory.
|
||||||
|
|
||||||
|
|
||||||
```
|
```
|
||||||
docker run -it -p 80:8080 \
|
docker run -it -p 80:8080 \
|
||||||
--mount src="/absolute/path/on/host",target=/opt/geoserver_data/,type=bind \
|
--mount src="/absolute/path/on/host",target=/opt/geoserver_data/,type=bind \
|
||||||
|
|
@ -61,11 +60,11 @@ The environment variable `SKIP_DEMO_DATA` can be set to `true` to create an empt
|
||||||
|
|
||||||
### 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:
|
||||||
|
|
||||||
* ``INSTALL_EXTENSIONS`` to ``true`` to download and install extensions
|
- `INSTALL_EXTENSIONS` to `true` to download and install extensions
|
||||||
* ``STABLE_EXTENSIONS`` list of extensions to download and install
|
- `STABLE_EXTENSIONS` list of extensions to download and install
|
||||||
* ``CORS_ENABLED``
|
- `CORS_ENABLED`
|
||||||
|
|
||||||
Example installing wps and ysld extensions:
|
Example installing wps and ysld extensions:
|
||||||
|
|
||||||
|
|
@ -112,11 +111,21 @@ docker run -it -p 80:8080 \
|
||||||
|
|
||||||
**Note:** Do not change the target value!
|
**Note:** Do not change the target value!
|
||||||
|
|
||||||
|
### How to change Tomcat default port?
|
||||||
|
|
||||||
|
If you want to change the default Tomcat port (8080) to e.g. 80, you can use:
|
||||||
|
|
||||||
|
```
|
||||||
|
docker run -it -p 80:80 \
|
||||||
|
--env TOMCAT_HTTP_PORT=80 \
|
||||||
|
docker.osgeo.org/geoserver:2.21.1
|
||||||
|
```
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
||||||
### How to watch geoserver.log from host?
|
### How to watch geoserver.log from host?
|
||||||
|
|
||||||
To watch ``geoserver.log`` of a running container:
|
To watch `geoserver.log` of a running container:
|
||||||
|
|
||||||
```
|
```
|
||||||
docker exec -it {CONTAINER_ID} tail -f /opt/geoserver_data/logs/geoserver.log
|
docker exec -it {CONTAINER_ID} tail -f /opt/geoserver_data/logs/geoserver.log
|
||||||
|
|
@ -124,11 +133,11 @@ docker exec -it {CONTAINER_ID} tail -f /opt/geoserver_data/logs/geoserver.log
|
||||||
|
|
||||||
### How to use the docker-compose demo?
|
### How to use the docker-compose demo?
|
||||||
|
|
||||||
The ``docker-compose-demo.yml`` to build with your own data directory and extensions.
|
The `docker-compose-demo.yml` to build with your own data directory and extensions.
|
||||||
|
|
||||||
Stage geoserver data directory contents into ``geoserver_data``, and any extensions into ``additional_libs`` folder.
|
Stage geoserver data directory contents into `geoserver_data`, and any extensions into `additional_libs` folder.
|
||||||
|
|
||||||
Run ``docker-compose``:
|
Run `docker-compose`:
|
||||||
|
|
||||||
```
|
```
|
||||||
docker-compose -f docker-compose-demo.yml up --build
|
docker-compose -f docker-compose-demo.yml up --build
|
||||||
|
|
@ -136,7 +145,6 @@ docker-compose -f docker-compose-demo.yml up --build
|
||||||
|
|
||||||
## How to Build?
|
## How to Build?
|
||||||
|
|
||||||
|
|
||||||
### How to build a local image?
|
### How to build a local image?
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
@ -199,16 +207,19 @@ docker build \
|
||||||
OSGeo maintains geoserver-docker.osgeo.org repository for publishing. The results are combined into docker.osgeo.org repository alongside other software such as PostGIS.
|
OSGeo maintains geoserver-docker.osgeo.org repository for publishing. The results are combined into docker.osgeo.org repository alongside other software such as PostGIS.
|
||||||
|
|
||||||
Build locally:
|
Build locally:
|
||||||
|
|
||||||
```
|
```
|
||||||
docker build -t geoserver-docker.osgeo.org/geoserver:2.21.1 .
|
docker build -t geoserver-docker.osgeo.org/geoserver:2.21.1 .
|
||||||
```
|
```
|
||||||
|
|
||||||
Login using with osgeo user id:
|
Login using with osgeo user id:
|
||||||
|
|
||||||
```
|
```
|
||||||
docker login geoserver-docker.osgeo.org
|
docker login geoserver-docker.osgeo.org
|
||||||
```
|
```
|
||||||
|
|
||||||
Push to osgeo repository:
|
Push to osgeo repository:
|
||||||
|
|
||||||
```
|
```
|
||||||
docker push geoserver-docker.osgeo.org/geoserver:2.21.1
|
docker push geoserver-docker.osgeo.org/geoserver:2.21.1
|
||||||
```
|
```
|
||||||
|
|
|
||||||
|
|
@ -60,5 +60,11 @@ if [ "${CORS_ENABLED}" = "true" ]; then
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# replace the default port with the one provided by the environment variable
|
||||||
|
if [ ! -z "$TOMCAT_HTTP_PORT" ]; then
|
||||||
|
echo "Tomcat HTTP port set to $TOMCAT_HTTP_PORT"
|
||||||
|
sed -i "s/port=\"[0-9]\+\" protocol=\"HTTP\/1.1\"/port=\"$TOMCAT_HTTP_PORT\" protocol=\"HTTP\/1.1\"/" $CATALINA_HOME/conf/server.xml
|
||||||
|
fi
|
||||||
|
|
||||||
# start the tomcat
|
# start the tomcat
|
||||||
$CATALINA_HOME/bin/catalina.sh run
|
$CATALINA_HOME/bin/catalina.sh run
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue