Completed for a grade of three

This commit is contained in:
2026-10-08 20:26:09 +03:00
parent 16fa679bc0
commit b38a33308d
100 changed files with 2832 additions and 602 deletions
+16
View File
@@ -0,0 +1,16 @@
#!/bin/sh
# Creates local secrets for the Compose stack. Never overwrites an existing secret:
# the PostgreSQL volume is initialised with the first password and keeps it.
set -eu
cd "$(dirname "$0")/.."
mkdir -p secrets
if [ ! -s secrets/db_password ]; then
# Readable by the non-root users inside the api/postgres containers (bind-mounted as is).
umask 022
openssl rand -hex 24 > secrets/db_password
echo "created secrets/db_password"
else
echo "secrets/db_password already exists, keeping it"
fi
+7
View File
@@ -0,0 +1,7 @@
#!/bin/sh
# Restarts the API and PostgreSQL, keeping the named volume (no `down -v`, no re-seed).
set -eu
cd "$(dirname "$0")/.."
docker compose stop api postgres
docker compose up -d --wait postgres api