ops: add containers and monitoring

This commit is contained in:
2026-09-24 10:51:02 +03:00
parent 1f511728c9
commit dd3679a763
10 changed files with 369 additions and 0 deletions
+21
View File
@@ -0,0 +1,21 @@
#!/bin/sh
set -eu
if [ -e secrets/postgres_password ] || [ -e secrets/valkey_password ] || [ -e secrets/database_url ] || [ -e secrets/cache_url ] || [ -e secrets/grafana_admin_password ]; then
echo "secrets already exist" >&2
exit 1
fi
umask 077
mkdir -p secrets
postgres_password=$(openssl rand -hex 24)
valkey_password=$(openssl rand -hex 24)
grafana_admin_password=$(openssl rand -hex 24)
printf '%s' "$postgres_password" > secrets/postgres_password
printf '%s' "$valkey_password" > secrets/valkey_password
printf 'postgres://messenger:%s@postgres:5432/messenger?sslmode=disable' "$postgres_password" > secrets/database_url
printf 'redis://default:%s@valkey:6379/0' "$valkey_password" > secrets/cache_url
printf '%s' "$grafana_admin_password" > secrets/grafana_admin_password