Skip to content

Commit

Permalink
initial version of separate config
Browse files Browse the repository at this point in the history
  • Loading branch information
maaikelimper committed May 13, 2024
1 parent 3af1e83 commit d4393b7
Show file tree
Hide file tree
Showing 10 changed files with 203 additions and 0 deletions.
45 changes: 45 additions & 0 deletions docker_compose/README.md
Original file line number Diff line number Diff line change
@@ -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.


21 changes: 21 additions & 0 deletions docker_compose/docker-compose.elasticsearch.yml
Original file line number Diff line number Diff line change
@@ -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
9 changes: 9 additions & 0 deletions docker_compose/docker-compose.web-proxy.yml
Original file line number Diff line number Diff line change
@@ -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
28 changes: 28 additions & 0 deletions docker_compose/docker-compose.wis2box-api.yml
Original file line number Diff line number Diff line change
@@ -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:
11 changes: 11 additions & 0 deletions docker_compose/docker-compose.wis2box-auth.yml
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions docker_compose/docker-compose.wis2box-broker.yml
Original file line number Diff line number Diff line change
@@ -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
31 changes: 31 additions & 0 deletions docker_compose/docker-compose.wis2box-management.yml
Original file line number Diff line number Diff line change
@@ -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"]
28 changes: 28 additions & 0 deletions docker_compose/docker-compose.wis2box-minio.yml
Original file line number Diff line number Diff line change
@@ -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
9 changes: 9 additions & 0 deletions docker_compose/docker-compose.wis2box-ui.yml
Original file line number Diff line number Diff line change
@@ -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}
9 changes: 9 additions & 0 deletions docker_compose/docker-compose.wis2box-webapp.yml
Original file line number Diff line number Diff line change
@@ -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}

0 comments on commit d4393b7

Please sign in to comment.