From d4393b7c094bd4461995dbc5fa8f9163e05b8445 Mon Sep 17 00:00:00 2001 From: Maaike Date: Fri, 15 Mar 2024 09:39:23 +0100 Subject: [PATCH] initial version of separate config --- docker_compose/README.md | 45 +++++++++++++++++++ .../docker-compose.elasticsearch.yml | 21 +++++++++ docker_compose/docker-compose.web-proxy.yml | 9 ++++ docker_compose/docker-compose.wis2box-api.yml | 28 ++++++++++++ .../docker-compose.wis2box-auth.yml | 11 +++++ .../docker-compose.wis2box-broker.yml | 12 +++++ .../docker-compose.wis2box-management.yml | 31 +++++++++++++ .../docker-compose.wis2box-minio.yml | 28 ++++++++++++ docker_compose/docker-compose.wis2box-ui.yml | 9 ++++ .../docker-compose.wis2box-webapp.yml | 9 ++++ 10 files changed, 203 insertions(+) create mode 100644 docker_compose/README.md create mode 100644 docker_compose/docker-compose.elasticsearch.yml create mode 100644 docker_compose/docker-compose.web-proxy.yml create mode 100644 docker_compose/docker-compose.wis2box-api.yml create mode 100644 docker_compose/docker-compose.wis2box-auth.yml create mode 100644 docker_compose/docker-compose.wis2box-broker.yml create mode 100644 docker_compose/docker-compose.wis2box-management.yml create mode 100644 docker_compose/docker-compose.wis2box-minio.yml create mode 100644 docker_compose/docker-compose.wis2box-ui.yml create mode 100644 docker_compose/docker-compose.wis2box-webapp.yml diff --git a/docker_compose/README.md b/docker_compose/README.md new file mode 100644 index 00000000..e64e27b1 --- /dev/null +++ b/docker_compose/README.md @@ -0,0 +1,45 @@ +# docker compose readme + +## Docker Compose + +This directory contains separate docker-compose files for each of the services that are part of the project. + +The directory 'core' contains the main docker-compose file that enable the publication of WIS2 data and metadata notifications. + +The directory 'frontend' contains files for the web-based frontend services. + +## Core + +The following services are part of the core wis2box-services: + +### wis2box-management + +This is a set of python modules that provide the core functionality of the WIS2Box. The command that keeps the container running is: + +```bash +wis2box pubsub subscribe +``` + +This command subscribes to the internal WIS2Box message broker on the topic wis2box/#. + +By default the internal WIS2Box message broker also serve as the public-facing broker by setting = + +```bash +WIS2BOX_BROKER_PUBLIC=mqtt://${WIS2BOX_BROKER_USERNAME}:${WIS2BOX_BROKER_PASSWORD}@mosquitto:1883 +``` + +### wis2box-broker + +Mosquitto-service that provides the (internal) message broker for the WIS2Box. + +### wis2box-api + +This is a pygeoapi instance that provides access to the WIS2Box data and metadata. For the source-code see github repository: https://github.com/wmo-im/wis2box-api + +The default backend for the wis2box-api is provided by an elasticsearch container on the same (docker) network. + +### wis2box-elasticsearch + +An elasticsearch instance that provides the backend for the wis2box-api. + + diff --git a/docker_compose/docker-compose.elasticsearch.yml b/docker_compose/docker-compose.elasticsearch.yml new file mode 100644 index 00000000..275a394a --- /dev/null +++ b/docker_compose/docker-compose.elasticsearch.yml @@ -0,0 +1,21 @@ +services: + elasticsearch: + container_name: elasticsearch + image: docker.elastic.co/elasticsearch/elasticsearch:8.6.2 + restart: always + environment: + - discovery.type=single-node + - discovery.seed_hosts=[] + - node.name=elasticsearch-01 + - bootstrap.memory_lock=true + - "ES_JAVA_OPTS=-Xms512m -Xmx512m" + - cluster.name=es-wis2box + - xpack.security.enabled=false + mem_limit: 1.5g + memswap_limit: 1.5g + volumes: + - ${ELASTICSEARH_DATA}:/usr/share/elasticsearch/data:rw + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:9200"] + interval: 5s + retries: 100 \ No newline at end of file diff --git a/docker_compose/docker-compose.web-proxy.yml b/docker_compose/docker-compose.web-proxy.yml new file mode 100644 index 00000000..a3337b72 --- /dev/null +++ b/docker_compose/docker-compose.web-proxy.yml @@ -0,0 +1,9 @@ +services: + web-proxy: + container_name: nginx + image: nginx:alpine + restart: always + volumes: + - ${NGINX_CONF}:/etc/nginx/conf.d/default.conf + ports: + - 80:80 \ No newline at end of file diff --git a/docker_compose/docker-compose.wis2box-api.yml b/docker_compose/docker-compose.wis2box-api.yml new file mode 100644 index 00000000..fbb4239a --- /dev/null +++ b/docker_compose/docker-compose.wis2box-api.yml @@ -0,0 +1,28 @@ +services: + wis2box-api: + container_name: wis2box-api + image: ghcr.io/wmo-im/wis2box-api:latest + restart: always + environment: + - WIS2BOX_API_URL=${WIS2BOX_API_URL} + - WIS2BOX_URL=${WIS2BOX_URL} + - WIS2BOX_API_BACKEND_URL=$(WIS2BOX_API_BACKEND_URL) + - WIS2BOX_BASEMAP_URL=${WIS2BOX_BASEMAP_URL} + - WIS2BOX_BASEMAP_ATTRIBUTION=${WIS2BOX_BASEMAP_ATTRIBUTION} + - WIS2BOX_BROKER_USERNAME=${WIS2BOX_BROKER_USERNAME} + - WIS2BOX_BROKER_PASSWORD=${WIS2BOX_BROKER_PASSWORD} + - WIS2BOX_BROKER_HOST=${WIS2BOX_BROKER_HOST} + - WIS2BOX_BROKER_PORT=${WIS2BOX_BROKER_PORT} + - WIS2BOX_STORAGE_SOURCE=${WIS2BOX_STORAGE_SOURCE} + depends_on: + elasticsearch: + condition: service_healthy + volumes: + - api-config:/data/wis2box/config/pygeoapi/:rw + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost/oapi/admin/resources"] + interval: 5s + retries: 100 + +volumes: + api-config: \ No newline at end of file diff --git a/docker_compose/docker-compose.wis2box-auth.yml b/docker_compose/docker-compose.wis2box-auth.yml new file mode 100644 index 00000000..600db034 --- /dev/null +++ b/docker_compose/docker-compose.wis2box-auth.yml @@ -0,0 +1,11 @@ +services: + wis2box-auth: + container_name: wis2box-auth + image: ghcr.io/wmo-im/wis2box-auth:latest + restart: always + env_file: + - wis2box.env + volumes: + - ${AUTH_DATA}:/data/wis2box:rw + depends_on: + - wis2box-management \ No newline at end of file diff --git a/docker_compose/docker-compose.wis2box-broker.yml b/docker_compose/docker-compose.wis2box-broker.yml new file mode 100644 index 00000000..71d5fc74 --- /dev/null +++ b/docker_compose/docker-compose.wis2box-broker.yml @@ -0,0 +1,12 @@ +services: + mosquitto: + image: ghcr.io/wmo-im/wis2box-broker:latest + restart: always + build: + context: ./wis2box-broker + environment: + - WIS2BOX_BROKER_USERNAME=${WIS2BOX_BROKER_USERNAME} + - WIS2BOX_BROKER_PASSWORD=${WIS2BOX_BROKER_PASSWORD} + + ports: + - 1883:1883 \ No newline at end of file diff --git a/docker_compose/docker-compose.wis2box-management.yml b/docker_compose/docker-compose.wis2box-management.yml new file mode 100644 index 00000000..b414b0d3 --- /dev/null +++ b/docker_compose/docker-compose.wis2box-management.yml @@ -0,0 +1,31 @@ +services: + wis2box-management: + container_name: wis2box-management + mem_limit: 1g + memswap_limit: 1g + restart: always + #image: ghcr.io/wmo-im/wis2box-management:1.0.beta1 + build: + context: ./wis2box-management + environment: + - WIS2BOX_API_URL=${WIS2BOX_API_URL} + - WIS2BOX_URL=${WIS2BOX_URL} + - WIS2BOX_API_BACKEND_URL=$(WIS2BOX_API_BACKEND_URL) + - WIS2BOX_BASEMAP_URL=${WIS2BOX_BASEMAP_URL} + - WIS2BOX_BASEMAP_ATTRIBUTION=${WIS2BOX_BASEMAP_ATTRIBUTION} + - WIS2BOX_BROKER_USERNAME=${WIS2BOX_BROKER_USERNAME} + - WIS2BOX_BROKER_PASSWORD=${WIS2BOX_BROKER_PASSWORD} + - WIS2BOX_BROKER_HOST=${WIS2BOX_BROKER_HOST} + - WIS2BOX_BROKER_PORT=${WIS2BOX_BROKER_PORT} + - WIS2BOX_STORAGE_SOURCE=${WIS2BOX_STORAGE_SOURCE} + + volumes: + - ${WIS2BOX_HOST_DATADIR}:/data/wis2box:rw + depends_on: + minio: + condition: service_healthy + mosquitto: + condition: service_started + wis2box-api: + condition: service_healthy + command: ["wis2box", "pubsub" , "subscribe"] \ No newline at end of file diff --git a/docker_compose/docker-compose.wis2box-minio.yml b/docker_compose/docker-compose.wis2box-minio.yml new file mode 100644 index 00000000..392c2ed7 --- /dev/null +++ b/docker_compose/docker-compose.wis2box-minio.yml @@ -0,0 +1,28 @@ +services: + minio: + container_name: wis2box-minio + image: minio/minio:RELEASE.2022-12-02T19-19-22Z.fips + mem_limit: 512m + memswap_limit: 512m + restart: always + environment: + - MINIO_ROOT_USER=${WIS2BOX_STORAGE_USERNAME} + - MINIO_ROOT_PASSWORD=${WIS2BOX_STORAGE_PASSWORD} + - MINIO_PROMETHEUS_AUTH_TYPE=public + - MINIO_NOTIFY_MQTT_ENABLE_WIS2BOX=on + - MINIO_NOTIFY_MQTT_USERNAME_WIS2BOX=${WIS2BOX_BROKER_USERNAME} + - MINIO_NOTIFY_MQTT_PASSWORD_WIS2BOX=${WIS2BOX_BROKER_PASSWORD} + - MINIO_NOTIFY_MQTT_BROKER_WIS2BOX=tcp://${WIS2BOX_BROKER_HOST}:${WIS2BOX_BROKER_PORT} + - MINIO_NOTIFY_MQTT_TOPIC_WIS2BOX=wis2box/storage + - MINIO_NOTIFY_MQTT_QOS_WIS2BOX=1 + command: server --console-address ":9001" /data + volumes: + - ${MINIO_DATA}:/data + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"] + interval: 5s + timeout: 1s + retries: 3 + depends_on: + mosquitto: + condition: service_started \ No newline at end of file diff --git a/docker_compose/docker-compose.wis2box-ui.yml b/docker_compose/docker-compose.wis2box-ui.yml new file mode 100644 index 00000000..adbeb5f8 --- /dev/null +++ b/docker_compose/docker-compose.wis2box-ui.yml @@ -0,0 +1,9 @@ +services: + wis2box-ui: + container_name: wis2box-ui + image: ghcr.io/wmo-im/wis2box-ui:latest + environment: + - WIS2BOX_API_URL=${WIS2BOX_API_URL} + - WIS2BOX_URL=${WIS2BOX_URL} + - WIS2BOX_BASEMAP_URL=${WIS2BOX_BASEMAP_URL} + - WIS2BOX_BASEMAP_ATTRIBUTION=${WIS2BOX_BASEMAP_ATTRIBUTION} \ No newline at end of file diff --git a/docker_compose/docker-compose.wis2box-webapp.yml b/docker_compose/docker-compose.wis2box-webapp.yml new file mode 100644 index 00000000..9540cc8d --- /dev/null +++ b/docker_compose/docker-compose.wis2box-webapp.yml @@ -0,0 +1,9 @@ +services: + wis2box-webapp: + container_name: wis2box-webapp + image: ghcr.io/wmo-im/wis2box-webapp:latest + environment: + - WIS2BOX_API_URL=${WIS2BOX_API_URL} + - WIS2BOX_URL=${WIS2BOX_URL} + - WIS2BOX_BASEMAP_URL=${WIS2BOX_BASEMAP_URL} + - WIS2BOX_BASEMAP_ATTRIBUTION=${WIS2BOX_BASEMAP_ATTRIBUTION} \ No newline at end of file