From 0fc4a5bfd0315831ad3526907526029b4c4c27e7 Mon Sep 17 00:00:00 2001 From: mo8it Date: Sun, 27 Aug 2023 23:07:52 +0200 Subject: [PATCH] Add collective-score-rust-server --- containers/collective_score_rust_server.fish | 26 ++++++++++++++++++++ volumes/traefik/dynamic.yml | 7 ++++++ 2 files changed, 33 insertions(+) create mode 100755 containers/collective_score_rust_server.fish diff --git a/containers/collective_score_rust_server.fish b/containers/collective_score_rust_server.fish new file mode 100755 index 0000000..ac8dc41 --- /dev/null +++ b/containers/collective_score_rust_server.fish @@ -0,0 +1,26 @@ +#!/usr/bin/env fish + +set -l container_name collective-score-rust-server +set -l container_volumes_dir ~/volumes/$container_name + +buildah build -t $container_name:latest ~/code/collective-score + +set -l db_container_name collective-score-rust-server-db +set -l db_container_volumes_dir $container_volumes_dir/db +set -l db_env_file $container_volumes_dir/.postgres.env + +podman-default-create \ + $db_container_name \ + --network traefik \ + -v $db_container_volumes_dir:/var/lib/postgresql/data:Z \ + -e TZ=Europe/Berlin \ + -e PGTZ=Europe/Berlin \ + --env-file $db_env_file \ + --label "io.containers.autoupdate=registry" \ + docker.io/library/postgres:15-alpine + +podman-default-create \ + $container_name \ + --network traefik \ + -v $container_volumes_dir/data:/volumes/data:Z \ + localhost/$container_name:latest diff --git a/volumes/traefik/dynamic.yml b/volumes/traefik/dynamic.yml index 4f408ea..7913e7f 100644 --- a/volumes/traefik/dynamic.yml +++ b/volumes/traefik/dynamic.yml @@ -124,6 +124,9 @@ http: to_collective_score: rule: Host(`collective-score.mo8it.com`) service: collective_score + to_collective_score_rust: + rule: Host(`collective-score-rust.mo8it.com`) + service: collective_score_rust {{ $n_ttyds := 28 }} {{ range $index, $num := until $n_ttyds }} to_ttyd{{ $num }}: @@ -215,6 +218,10 @@ http: loadBalancer: servers: - url: http://collective-score-server + collective_score_rust: + loadBalancer: + servers: + - url: http://collective-score-rust-server {{ range $index, $num := until $n_ttyds }} ttyd{{ $num }}: loadBalancer: