-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
240 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,6 @@ | ||
# Centralized microservices configuration | ||
# Cloud Native GeoServer Externalized configuration sample repository | ||
|
||
This directory contains the spring configuration properties or yaml files for all | ||
GeoServer microservices, as used by the config-service, following | ||
This repository contains sample/default spring configuration files for all | ||
micro-services in the [Cloud Native GeoServer](https://github.com/camptocamp/geoserver-microservices) project, as used by the `config-service`, following | ||
[spring-cloud-config](https://cloud.spring.io/spring-cloud-config/reference/html/) guidelines. | ||
|
||
The contents of this directory are copied to the `config-service`'s `.jar` file at build time, | ||
so they're accessible as classpath resources. Nonetheless, it's advisable to not use classpath | ||
configuration, and hence the default docker composition at the project's root directory sets | ||
this directory up as a bound volume to the `config-service` container(s). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,209 @@ | ||
version: "3.8" | ||
# This docker composition can be used as a quick start. Docker images will be fetch from docker hub's | ||
# couldnativegeoserver organization. The config-service is set up to use a public remote git repository. At start up, it'll | ||
# clone it to the service instance container's filesystem and serve application configurations from there. | ||
# | ||
volumes: | ||
postgresql_config_data: # volume for postgresql data, used to store the geoserver config through jdbcconfig | ||
rabbitmq_data: # volume for rabbitmq data, so it doesn't create an anonymous one on each container | ||
|
||
networks: | ||
gs-cloud-network: | ||
driver: bridge | ||
|
||
services: | ||
rabbitmq: | ||
image: rabbitmq:3-management | ||
restart: always | ||
environment: | ||
RABBITMQ_DEFAULT_USER: "guest" | ||
RABBITMQ_DEFAULT_PASS: "guest" | ||
volumes: | ||
- rabbitmq_data:/var/lib/rabbitmq | ||
networks: | ||
- gs-cloud-network | ||
ports: | ||
- "5672:5672" | ||
- "15672:15672" | ||
|
||
database: | ||
image: cloudnativegeoserver/gs-cloud-database:0.2.0 | ||
environment: | ||
POSTGRES_DB: "geoserver_config" | ||
POSTGRES_USER: "geoserver" | ||
POSTGRES_PASSWORD: "geo5erver" | ||
ports: | ||
- 5432:5432 | ||
networks: | ||
- gs-cloud-network | ||
volumes: | ||
- postgresql_config_data:/var/lib/postgresql/data | ||
|
||
# Eureka service discovery. This is a Discovery First Bootstrap configuration. | ||
# The discovery service is the only fixed entry point. | ||
# Browse to http://localhost:8761 to check all services are registered. | ||
# Run docker-compose -f docker-compose.yml -f docker-compose-discovery-ha.yml to run extra discovery service instances for HA | ||
discovery: | ||
image: cloudnativegeoserver/gs-cloud-discovery-service:0.2.0 | ||
environment: | ||
SERVER_PORT: 8761 | ||
EUREKA_INSTANCE_HOSTNAME: discovery | ||
JAVA_OPTS: -Xmx128m -XX:ActiveProcessorCount=2 | ||
ports: | ||
- 8761:8761 # for development, so services can be run from localhost and find the discovery service running on docker | ||
networks: | ||
- gs-cloud-network | ||
healthcheck: | ||
test: ["CMD", "curl", "-f", "-m", "1", "http://localhost:8761/actuator/health"] | ||
interval: 1s | ||
timeout: 1s | ||
retries: 15 | ||
|
||
# Spring Cloud Config service, provides centralized configuration to all | ||
# microservices. Being a Discovery First Bootstrap configuration, it'll | ||
# register itself with the Eureka discovery service and can be scaled | ||
config: | ||
image: cloudnativegeoserver/gs-cloud-config-service:0.2.0 | ||
depends_on: | ||
- discovery | ||
environment: | ||
EUREKA_SERVER_URL: http://discovery:8761/eureka | ||
RABBITMQ_HOST: rabbitmq | ||
management_endpoint_health_show-details: always # never|always|when-authorized | ||
# 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 | ||
SPRING_PROFILES_ACTIVE: git | ||
# 'git' profile config | ||
CONFIG_GIT_URI: https://github.com/groldan/geoserver-microservices-config | ||
CONFIG_GIT_BASEDIR: /opt/app/git_config | ||
# 'native' profile config | ||
CONFIG_NATIVE_PATH: /opt/app/config | ||
networks: | ||
- gs-cloud-network | ||
healthcheck: | ||
test: ["CMD", "curl", "-f", "-m", "1", "http://localhost:8080/actuator/health"] | ||
interval: 1s | ||
timeout: 1s | ||
retries: 30 | ||
# wait until discovery service is available | ||
command: dockerize -wait http://discovery:8761/actuator/health --timeout 15s java -Xmx128m -jar /opt/app/config-service.jar | ||
|
||
# Application facade, provides a single entry point routing to all | ||
# microservices (e.g. http://localhost:9090/geoserver/wms, http://localhost:9090/geoserver/wfs, etc) | ||
gateway: | ||
image: cloudnativegeoserver/gs-cloud-gateway:0.2.0 | ||
depends_on: | ||
- discovery | ||
- config | ||
environment: | ||
EUREKA_SERVER_URL: http://discovery:8761/eureka | ||
ports: | ||
- 9090:8080 | ||
networks: | ||
- gs-cloud-network | ||
healthcheck: | ||
test: ["CMD", "curl", "-f", "http://localhost:8080/actuator/health"] | ||
# wait until config service is available | ||
command: dockerize -wait http://config:8080/gateway-service/default --timeout 60s java -Xmx128m -jar /opt/app/gateway-service.jar | ||
|
||
# catalog microservice, provides a unified catalog backend to all services | ||
catalog: | ||
image: cloudnativegeoserver/gs-cloud-catalog:0.2.0 | ||
depends_on: | ||
- discovery | ||
- config | ||
- database | ||
- rabbitmq | ||
environment: | ||
EUREKA_SERVER_URL: http://discovery:8761/eureka | ||
RABBITMQ_HOST: rabbitmq | ||
JDBCCONFIG_URL: "jdbc:postgresql://database:5432/geoserver_config" | ||
JDBCCONFIG_USERNAME: "geoserver" | ||
JDBCCONFIG_PASSWORD: "geo5erver" | ||
spring_cloud_config_fail-fast: "false" | ||
networks: | ||
- gs-cloud-network | ||
healthcheck: | ||
test: ["CMD", "curl", "-f", "http://localhost:8080/actuator/health"] | ||
command: dockerize -wait http://config:8080/catalog-service/default --timeout 60s java -Xmx256m -XX:ActiveProcessorCount=2 -jar /opt/app/catalog-service.jar | ||
|
||
# WFS microservice, port dynamically allocated to allow scaling (e.g docker-compose scale wfs=5) | ||
wfs: | ||
image: cloudnativegeoserver/gs-cloud-wfs:0.2.0 | ||
depends_on: | ||
- rabbitmq | ||
- catalog | ||
environment: | ||
EUREKA_SERVER_URL: http://discovery:8761/eureka | ||
RABBITMQ_HOST: rabbitmq | ||
networks: | ||
- gs-cloud-network | ||
healthcheck: | ||
test: ["CMD", "curl", "-f", "http://localhost:8080/actuator/health"] | ||
command: dockerize --timeout 60s -wait http://config:8080/wfs-service/default -wait http://catalog:8080/actuator/health java -Xmx256m -XX:ActiveProcessorCount=2 -jar /opt/app/wfs-service.jar | ||
|
||
# WMS microservice, port dynamically allocated to allow scaling (e.g docker-compose scale wms=5) | ||
wms: | ||
image: cloudnativegeoserver/gs-cloud-wms:0.2.0 | ||
depends_on: | ||
- rabbitmq | ||
- catalog | ||
environment: | ||
EUREKA_SERVER_URL: http://discovery:8761/eureka | ||
RABBITMQ_HOST: rabbitmq | ||
networks: | ||
- gs-cloud-network | ||
healthcheck: | ||
test: ["CMD", "curl", "-f", "http://localhost:8080/actuator/health"] | ||
# wait until config service is available | ||
command: dockerize -wait http://config:8080/wms-service/default -wait http://catalog:8080/actuator/health --timeout 60s java -Xmx1G -XX:ActiveProcessorCount=2 -jar /opt/app/wms-service.jar | ||
|
||
# WCS microservice, port dynamically allocated to allow scaling (e.g docker-compose scale wcs=5) | ||
wcs: | ||
image: cloudnativegeoserver/gs-cloud-wcs:0.2.0 | ||
depends_on: | ||
- rabbitmq | ||
- catalog | ||
environment: | ||
EUREKA_SERVER_URL: http://discovery:8761/eureka | ||
RABBITMQ_HOST: rabbitmq | ||
networks: | ||
- gs-cloud-network | ||
healthcheck: | ||
test: ["CMD", "curl", "-f", "http://localhost:8080/actuator/health"] | ||
# wait until config service is available | ||
command: dockerize -wait http://config:8080/wcs-service/default -wait http://catalog:8080/actuator/health --timeout 60s java -Xmx1G -XX:ActiveProcessorCount=2 -jar /opt/app/wcs-service.jar | ||
|
||
# REST config microservice, port dynamically allocated to allow scaling (e.g docker-compose scale rest=5) | ||
rest: | ||
image: cloudnativegeoserver/gs-cloud-restconfig-v1:0.2.0 | ||
depends_on: | ||
- rabbitmq | ||
- catalog | ||
environment: | ||
EUREKA_SERVER_URL: http://discovery:8761/eureka | ||
RABBITMQ_HOST: rabbitmq | ||
networks: | ||
- gs-cloud-network | ||
healthcheck: | ||
test: ["CMD", "curl", "-f", "http://localhost:8080/actuator/health"] | ||
# wait until config service is available | ||
command: dockerize -wait http://config:8080/restconfig-service/default -wait http://catalog:8080/actuator/health --timeout 60s java -Xmx256m -XX:ActiveProcessorCount=2 -jar /opt/app/restconfig-service.jar | ||
|
||
# WEB UI microservice | ||
webui: | ||
image: cloudnativegeoserver/gs-cloud-web-ui:0.2.0 | ||
depends_on: | ||
- rabbitmq | ||
- catalog | ||
environment: | ||
EUREKA_SERVER_URL: http://discovery:8761/eureka | ||
RABBITMQ_HOST: rabbitmq | ||
networks: | ||
- gs-cloud-network | ||
healthcheck: | ||
test: ["CMD", "curl", "-f", "http://localhost:8080/actuator/health"] | ||
# wait until config service is available | ||
command: dockerize -wait http://config:8080/web-ui/default -wait http://catalog:8080/actuator/health --timeout 60s java -Xmx512m -XX:ActiveProcessorCount=2 -jar /opt/app/web-ui-service.jar | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters