Updated feedstack to include weatherdb and weatherapi containers

This commit is contained in:
2026-03-17 16:17:06 +00:00
parent 29cac89fe8
commit 6fcdffd6c4
7 changed files with 80 additions and 0 deletions

View File

@@ -17,7 +17,19 @@ feedstack_weatherfeeder_container_tag: "latest"
feedstack_weatherprocessor_container_image: "harbor.maximumdirect.net/library/weatherprocessor"
feedstack_weatherprocessor_container_tag: "latest"
# Define the default weatherapi container image and tag.
feedstack_weatherapi_container_image: "harbor.maximumdirect.net/library/weatherapi"
feedstack_weatherapi_container_tag: "latest"
# Define the default NATS container image and tag.
feedstack_nats_container_image: "nats"
feedstack_nats_container_tag: "linux"
# Define the default weatherdb container image and tag.
feedstack_weatherdb_container_image: "postgres"
feedstack_weatherdb_container_tag: "16"
# Define the default weatherdb database user and password.
feedstack_weatherdb_user: "weatherdb"
feedstack_weatherdb_password: "weatherdb"
feedstack_weatherdb_database: "weatherdb"

View File

@@ -6,6 +6,7 @@
loop:
- weatherfeeder
- weatherprocessor
- weatherapi
- nats/config
- nats/data
loop_control:
@@ -19,6 +20,12 @@
dest: "{{ docker_appdata_directory }}/weatherfeeder/config.yml"
become: true
- name: Create the weatherapi configuration file from the provided template.
template:
src: "weatherapi/config.yml.j2"
dest: "{{ docker_appdata_directory }}/weatherapi/config.yml"
become: true
- name: Create the weatherprocessor configuration file from the provided template.
template:
src: "weatherprocessor/config.yml.j2"

View File

@@ -0,0 +1,9 @@
---
- name: weatherdb
driver: postgres
params:
uri: postgres://weatherdb:5432/{{ feedstack_weatherdb_database }}?sslmode=disable
username: {{ feedstack_weatherdb_user }}
password: {{ feedstack_weatherdb_password }}
...

View File

@@ -73,12 +73,22 @@ sinks:
params:
url: nats://nats:4222
exchange: weatherfeeder
- name: weatherdb
driver: postgres
params:
uri: postgres://weatherdb:5432/{{ feedstack_weatherdb_database }}?sslmode=disable
username: {{ feedstack_weatherdb_user }}
password: {{ feedstack_weatherdb_password }}
# optional: route events to this sink
routes:
- sink: nats_weatherfeeder
kinds: ["observation", "forecast", "alert"]
- sink: weatherdb
kinds: ["observation", "forecast", "alert"]
- sink: stdout
kinds: ["observation", "forecast", "alert"]
...

View File

@@ -0,0 +1,22 @@
---
weatherapi:
# Define the name of this container.
name: "weatherapi"
# Define the docker image to be used for this container.
image: "{{ feedstack_weatherapi_container_image }}:{{ feedstack_weatherapi_container_tag }}"
# Define ports that should be opened to the outside world.
ports:
- "8080:8080"
# Define the volumes that should be mounted into the container.
volumes:
- "{{ docker_appdata_directory }}/weatherapi/config.yml:/weatherapi/config.yml:ro"
# Define the dependencies for this container.
dependencies:
- weatherdb
...

View File

@@ -0,0 +1,19 @@
---
weatherdb:
# Define the name of this container.
name: "weatherdb"
# Define the docker image to be used for this container.
image: "{{ feedstack_weatherdb_container_image }}:{{ feedstack_weatherdb_container_tag }}"
# Define the volumes that should be mounted into the container.
volumes:
- "{{ docker_appdata_directory }}/weatherdb/db:/var/lib/postgresql/data"
# Define environment variables to be passed to the container.
environment_variables:
- "POSTGRES_USER={{ feedstack_weatherdb_user }}"
- "POSTGRES_PASSWORD={{ feedstack_weatherdb_password }}"
- "POSTGRES_DB={{ feedstack_weatherdb_database }}"
...

View File

@@ -23,6 +23,7 @@ weatherfeeder:
# Define the dependencies for this container.
dependencies:
- nats
- weatherdb
# Define environment variables to be passed to the container.
#environment_variables: []