From df171dcb1323af9736d0288341b896835301d57b Mon Sep 17 00:00:00 2001 From: Gabriel Roldan Date: Fri, 27 Sep 2024 13:51:24 +0200 Subject: [PATCH] improvements for the development docker composition * use a postgis docker image with arm64 support * add shell scripts for to run docker compose with the different catalog backends --- README.md | 18 +++++++-- compose/.env | 1 - compose/catalog-datadir.yml | 2 + compose/catalog-jdbcconfig.yml | 2 + compose/catalog-pgconfig.yml | 2 + compose/compose.yml | 74 +++++++++++----------------------- compose/datadir | 3 ++ compose/jdbcconfig | 3 ++ compose/pgconfig | 3 ++ compose/templates.yml | 4 +- 10 files changed, 55 insertions(+), 57 deletions(-) create mode 100755 compose/datadir create mode 100755 compose/jdbcconfig create mode 100755 compose/pgconfig diff --git a/README.md b/README.md index 2f0ef81d0..ff870216a 100644 --- a/README.md +++ b/README.md @@ -213,8 +213,13 @@ initializes a volume with the default GeoServer release data directory. Run with: ```bash -$ alias dcd="docker compose -f compose.yml -f catalog-datadir.yml" -$ dcd up -d +$ docker compose -f compose.yml -f catalog-datadir.yml +``` + +or the more convenient shell script: + +```bash +$ ./datadir up -d ``` #### PostgreSQL Catalog back-end @@ -233,8 +238,13 @@ and not part of the GeoServer Cloud deployment. Run with: ```bash -$ alias dcp="docker compose -f compose.yml -f catalog-pgconfig.yml" -$ dcp up -d +$ docker compose -f compose.yml -f catalog-pgconfig.yml +``` + +Or the more convenient shell script: + +``` +$ ./pgconfig up -d ``` **PGBouncer**: diff --git a/compose/.env b/compose/.env index bcd95c562..a608cf674 100644 --- a/compose/.env +++ b/compose/.env @@ -1,5 +1,4 @@ # docker-compose default environment variable values -COMPOSE_PROJECT_NAME=gscloud_dev TAG=1.9-SNAPSHOT ACL_TAG=2.3.0 GS_USER="1000:1000" diff --git a/compose/catalog-datadir.yml b/compose/catalog-datadir.yml index 28a80588e..f01890be7 100644 --- a/compose/catalog-datadir.yml +++ b/compose/catalog-datadir.yml @@ -4,6 +4,8 @@ # Note the default data directory location is /opt/app/data_directory # To set it to a different path, change the mount point and add the following env variable: GEOSERVER_DATA_DIR: +name: gscloud_dev_datadir + volumes: datadir: driver_opts: diff --git a/compose/catalog-jdbcconfig.yml b/compose/catalog-jdbcconfig.yml index 9041aebc0..37fa0ed0a 100644 --- a/compose/catalog-jdbcconfig.yml +++ b/compose/catalog-jdbcconfig.yml @@ -1,3 +1,5 @@ +name: gscloud_dev_jdbcconfig + volumes: jdbcconfig_data: # volume for postgresql data, used to store the geoserver config through jdbcconfig diff --git a/compose/catalog-pgconfig.yml b/compose/catalog-pgconfig.yml index de497ae54..0e9e8c841 100644 --- a/compose/catalog-pgconfig.yml +++ b/compose/catalog-pgconfig.yml @@ -1,3 +1,5 @@ +name: gscloud_dev_pgconfig + volumes: pgconfigdb_data: # volume for postgresql data, used to store the geoserver config through pgconfig backend diff --git a/compose/compose.yml b/compose/compose.yml index 732ab555e..24bf33204 100644 --- a/compose/compose.yml +++ b/compose/compose.yml @@ -8,7 +8,21 @@ volumes: type: none o: bind device: $PWD/../config - + +x-gs-dependencies: &gs-dependencies + rabbitmq: + condition: service_healthy + required: true + discovery: + condition: service_healthy + required: true + acl: + condition: service_healthy + required: true + postgis: + condition: service_started + required: true + services: acl: @@ -32,7 +46,7 @@ services: #- SPRING_PROFILES_ACTIVE=logging_debug,logging_debug_events depends_on: acldb: - condition: service_healthy + condition: service_started required: true rabbitmq: condition: service_healthy @@ -120,13 +134,7 @@ services: image: geoservercloud/geoserver-cloud-wfs:${TAG} environment: JAVA_OPTS: "${JAVA_OPTS_WFS}" - depends_on: - rabbitmq: - condition: service_healthy - required: true - discovery: - condition: service_started - required: true + depends_on: *gs-dependencies wms: image: geoservercloud/geoserver-cloud-wms:${TAG} @@ -135,13 +143,7 @@ services: service: gstemplate environment: JAVA_OPTS: "${JAVA_OPTS_WMS}" - depends_on: - rabbitmq: - condition: service_healthy - required: true - discovery: - condition: service_started - required: true + depends_on: *gs-dependencies wcs: extends: @@ -150,13 +152,7 @@ services: image: geoservercloud/geoserver-cloud-wcs:${TAG} environment: JAVA_OPTS: "${JAVA_OPTS_WCS}" - depends_on: - rabbitmq: - condition: service_healthy - required: true - discovery: - condition: service_started - required: true + depends_on: *gs-dependencies wps: extends: @@ -165,13 +161,7 @@ services: image: geoservercloud/geoserver-cloud-wps:${TAG} environment: JAVA_OPTS: "${JAVA_OPTS_WPS}" - depends_on: - rabbitmq: - condition: service_healthy - required: true - discovery: - condition: service_started - required: true + depends_on: *gs-dependencies gwc: extends: @@ -180,13 +170,7 @@ services: image: geoservercloud/geoserver-cloud-gwc:${TAG} environment: JAVA_OPTS: "${JAVA_OPTS_GWC}" - depends_on: - rabbitmq: - condition: service_healthy - required: true - discovery: - condition: service_started - required: true + depends_on: *gs-dependencies rest: extends: @@ -195,13 +179,7 @@ services: image: geoservercloud/geoserver-cloud-rest:${TAG} environment: JAVA_OPTS: "${JAVA_OPTS_REST}" - depends_on: - rabbitmq: - condition: service_healthy - required: true - discovery: - condition: service_started - required: true + depends_on: *gs-dependencies webui: extends: @@ -210,11 +188,5 @@ services: image: geoservercloud/geoserver-cloud-webui:${TAG} environment: JAVA_OPTS: "${JAVA_OPTS_WEBUI}" - depends_on: - rabbitmq: - condition: service_healthy - required: true - discovery: - condition: service_started - required: true + depends_on: *gs-dependencies diff --git a/compose/datadir b/compose/datadir new file mode 100755 index 000000000..bf78d4ced --- /dev/null +++ b/compose/datadir @@ -0,0 +1,3 @@ +#/bin/sh + +docker compose -f compose.yml -f catalog-datadir.yml $@ diff --git a/compose/jdbcconfig b/compose/jdbcconfig new file mode 100755 index 000000000..7b5bb2ac2 --- /dev/null +++ b/compose/jdbcconfig @@ -0,0 +1,3 @@ +#/bin/sh + +docker compose -f compose.yml -f catalog-jdbcconfig.yml $@ diff --git a/compose/pgconfig b/compose/pgconfig new file mode 100755 index 000000000..2111ef884 --- /dev/null +++ b/compose/pgconfig @@ -0,0 +1,3 @@ +#/bin/sh + +docker compose -f compose.yml -f catalog-pgconfig.yml $@ diff --git a/compose/templates.yml b/compose/templates.yml index f3232dcc6..c82f4b314 100644 --- a/compose/templates.yml +++ b/compose/templates.yml @@ -39,7 +39,9 @@ services: postgistemplate: extends: service: postgrestemplate - image: postgis/postgis:latest + #image: postgis/postgis:latest + #image with arm/64 support: + image: imresamu/postgis:15-3.4 environment: POSTGRES_DB: postgis POSTGRES_USER: postgis