Skip to content

Commit

Permalink
Improve dev compose JAVA_OPTS env variable set up
Browse files Browse the repository at this point in the history
  • Loading branch information
groldan committed Jan 29, 2024
1 parent 5ca2491 commit f0a40a2
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 44 deletions.
38 changes: 13 additions & 25 deletions compose/.env
Original file line number Diff line number Diff line change
Expand Up @@ -6,39 +6,27 @@ GS_USER="1000:1000"

BASE_PATH=/geoserver/cloud

GEOSERVER_DEFAULT_PROFILES="default,debug"
GEOSERVER_DEFAULT_PROFILES="default"
ACL_DEFAULT_PROFILES="acl"

#GEOSERVER_DEFAULT_PROFILES="acl,acl_debug"
#ACL_DEFAULT_PROFILES="acl,acl_debug"

EUREKA_SERVER_URL=http://discovery:8761/eureka
JDBCCONFIG_DBNAME=geoserver_config
JDBCCONFIG_URL=jdbc:postgresql://database:5432/${JDBCCONFIG_DBNAME}
JDBCCONFIG_USERNAME=geoserver
JDBCCONFIG_PASSWORD=geo5erver

# Remember to use docker-compose --compatibility

DISCOVERY_JAVA_OPTS=-XX:MaxRAMPercentage=80 -XshowSettings:system

CONFIG_JAVA_OPTS=-XX:MaxRAMPercentage=80 -XshowSettings:system

GATEWAY_JAVA_OPTS=-XX:MaxRAMPercentage=80 -XshowSettings:system

CATALOG_JAVA_OPTS=-XX:MaxRAMPercentage=80 -XshowSettings:system

WFS_JAVA_OPTS=-XX:MaxRAMPercentage=80 -XshowSettings:system

WMS_JAVA_OPTS=-XX:MaxRAMPercentage=80 -XshowSettings:system

WCS_JAVA_OPTS=-XX:MaxRAMPercentage=80 -XshowSettings:system

WPS_JAVA_OPTS=-XX:MaxRAMPercentage=80 -XshowSettings:system

REST_JAVA_OPTS=-XX:MaxRAMPercentage=80 -XshowSettings:system

WEBUI_JAVA_OPTS=-XX:MaxRAMPercentage=80 -XshowSettings:system
JAVA_OPTS_DEFAULT=-XX:MaxRAMPercentage=80 -XshowSettings:system

GWC_JAVA_OPTS=-XX:MaxRAMPercentage=80 -XshowSettings:system
JAVA_OPTS_GEOSERVER=$JAVA_OPTS_DEFAULT

JAVA_OPTS_DISCOVERY=$JAVA_OPTS_DEFAULT
JAVA_OPTS_CONFIG=$JAVA_OPTS_DEFAULT
JAVA_OPTS_GATEWAY=$JAVA_OPTS_DEFAULT
JAVA_OPTS_WFS=$JAVA_OPTS_GEOSERVER
JAVA_OPTS_WMS=$JAVA_OPTS_GEOSERVER
JAVA_OPTS_WCS=$JAVA_OPTS_GEOSERVER
JAVA_OPTS_WPS=$JAVA_OPTS_GEOSERVER
JAVA_OPTS_REST=$JAVA_OPTS_GEOSERVER
JAVA_OPTS_WEBUI=$JAVA_OPTS_GEOSERVER
JAVA_OPTS_GWC=$JAVA_OPTS_GEOSERVER
16 changes: 7 additions & 9 deletions compose/.env.yjp.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@

YJP_OPTS=-agentpath:/usr/local/YourKit-JavaProfiler-2023.9/bin/linux-x86-64/libyjpagent.so=broker_url=https://broker.yourkit.com/<broker-id>/,broker_token=<broker-token>

JAVA_OPTS=-XX:MaxRAMPercentage=80

WFS_JAVA_OPTS=$JAVA_OPTS $YJP_OPTS,sessionname=wfs-service
WMS_JAVA_OPTS=$JAVA_OPTS $YJP_OPTS,sessionname=wms-service
WCS_JAVA_OPTS=$JAVA_OPTS $YJP_OPTS,sessionname=wcs-service
WPS_JAVA_OPTS=$JAVA_OPTS $YJP_OPTS,sessionname=wps-service
REST_JAVA_OPTS=$JAVA_OPTS $YJP_OPTS,sessionname=rest-service
WEBUI_JAVA_OPTS=$JAVA_OPTS $YJP_OPTS,sessionname=webui-service
GWC_JAVA_OPTS=$JAVA_OPTS $YJP_OPTS,sessionname=gwc-service
JAVA_OPTS_WFS=$JAVA_OPTS_GEOSERVER $YJP_OPTS,sessionname=wfs-service
JAVA_OPTS_WMS=$JAVA_OPTS_GEOSERVER $YJP_OPTS,sessionname=wms-service
JAVA_OPTS_WCS=$JAVA_OPTS_GEOSERVER $YJP_OPTS,sessionname=wcs-service
JAVA_OPTS_WPS=$JAVA_OPTS_GEOSERVER $YJP_OPTS,sessionname=wps-service
JAVA_OPTS_REST=$JAVA_OPTS_GEOSERVER $YJP_OPTS,sessionname=rest-service
JAVA_OPTS_WEBUI=$JAVA_OPTS_GEOSERVER $YJP_OPTS,sessionname=webui-service
JAVA_OPTS_GWC=$JAVA_OPTS_GEOSERVER $YJP_OPTS,sessionname=gwc-service
20 changes: 10 additions & 10 deletions compose/compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ services:
image: geoservercloud/geoserver-cloud-config:${TAG}
user: ${GS_USER}
environment:
JAVA_OPTS: "${CONFIG_JAVA_OPTS}"
JAVA_OPTS: "${JAVA_OPTS_CONFIG}"
# Either 'git' or 'native'. Use the default sample git repository to download the services configuration from
# If 'git', BEWARE config server will look for a branch called "master", and github changed the default branch name to "main"
# For more information, see https://cloud.spring.io/spring-cloud-config/multi/multi__spring_cloud_config_server.html#_git_backend
Expand Down Expand Up @@ -65,7 +65,7 @@ services:
image: geoservercloud/geoserver-cloud-discovery:${TAG}
user: ${GS_USER}
environment:
JAVA_OPTS: "${DISCOVERY_JAVA_OPTS}"
JAVA_OPTS: "${JAVA_OPTS_DISCOVERY}"
ports:
- 8761:8761 # for development, so services can be run from localhost and find the discovery service running on docker
restart: unless-stopped
Expand All @@ -86,7 +86,7 @@ services:
discovery:
condition: service_healthy
environment:
JAVA_OPTS: ${GATEWAY_JAVA_OPTS}
JAVA_OPTS: "${JAVA_OPTS_GATEWAY}"
SPRING_PROFILES_ACTIVE: dev #exposes the catalog and config API at /api/v1/**
# eat our own dogfood and set a base path
GEOSERVER_BASE_PATH: ${BASE_PATH}
Expand All @@ -104,15 +104,15 @@ services:
service: gstemplate
image: geoservercloud/geoserver-cloud-wfs:${TAG}
environment:
JAVA_OPTS: "${WFS_JAVA_OPTS}"
JAVA_OPTS: "${JAVA_OPTS_WFS}"

wms:
image: geoservercloud/geoserver-cloud-wms:${TAG}
extends:
file: templates.yml
service: gstemplate
environment:
JAVA_OPTS: "${WMS_JAVA_OPTS}"
JAVA_OPTS: "${JAVA_OPTS_WMS}"
deploy:
resources:
limits:
Expand All @@ -124,37 +124,37 @@ services:
service: gstemplate
image: geoservercloud/geoserver-cloud-wcs:${TAG}
environment:
JAVA_OPTS: "${WCS_JAVA_OPTS}"
JAVA_OPTS: "${JAVA_OPTS_WCS}"

wps:
extends:
file: templates.yml
service: gstemplate
image: geoservercloud/geoserver-cloud-wps:${TAG}
environment:
JAVA_OPTS: "${WPS_JAVA_OPTS}"
JAVA_OPTS: "${JAVA_OPTS_WPS}"

gwc:
extends:
file: templates.yml
service: gstemplate
image: geoservercloud/geoserver-cloud-gwc:${TAG}
environment:
JAVA_OPTS: "${GWC_JAVA_OPTS}"
JAVA_OPTS: "${JAVA_OPTS_GWC}"

rest:
extends:
file: templates.yml
service: gstemplate
image: geoservercloud/geoserver-cloud-rest:${TAG}
environment:
JAVA_OPTS: "${REST_JAVA_OPTS}"
JAVA_OPTS: "${JAVA_OPTS_REST}"

webui:
extends:
file: templates.yml
service: gstemplate
image: geoservercloud/geoserver-cloud-webui:${TAG}
environment:
JAVA_OPTS: "${WEBUI_JAVA_OPTS}"
JAVA_OPTS: "${JAVA_OPTS_WEBUI}"

0 comments on commit f0a40a2

Please sign in to comment.