init commit: create skeleton from lab1
This commit is contained in:
Executable
+16
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
cd "$(dirname "$0")/.."
|
||||
mkdir -p secrets
|
||||
|
||||
if [ -f secrets/postgres_password ]; then
|
||||
echo "secrets/ уже существует — оставляю как есть"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
password="$(head -c 32 /dev/urandom | od -An -tx1 | tr -d ' \n')"
|
||||
printf '%s' "$password" > secrets/postgres_password
|
||||
printf 'postgresql+psycopg://messenger:%s@postgres:5432/messenger' "$password" > secrets/database_url
|
||||
|
||||
chmod 644 secrets/postgres_password secrets/database_url
|
||||
echo "OK: secrets/postgres_password и secrets/database_url созданы"
|
||||
Executable
+6
@@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
cd "$(dirname "$0")/.."
|
||||
|
||||
docker compose restart postgres
|
||||
docker compose restart api
|
||||
Reference in New Issue
Block a user