initial commit - code moved to separate repo

This commit is contained in:
Dobromir Popov
2024-02-22 04:19:38 +02:00
commit 560d503219
240 changed files with 105125 additions and 0 deletions

27
_deploy/setup-postgres.sh Normal file
View File

@ -0,0 +1,27 @@
#!/bin/sh
# Update APK repositories
apk update
# Install PostgreSQL
apk add postgresql postgresql-client
# Create a new database directory
mkdir -p /var/lib/postgresql/data
# Initialize the database
su - postgres -c "initdb /var/lib/postgresql/data"
# Start PostgreSQL
su - postgres -c "pg_ctl start -D /var/lib/postgresql/data -l logfile"
# Create a new user and database
su - postgres -c "psql -c \"CREATE USER myuser WITH PASSWORD 'mypassword';\""
su - postgres -c "psql -c \"CREATE DATABASE mydb OWNER myuser;\""
# Enable remote connections (optional)
echo "host all all 0.0.0.0/0 md5" >> /var/lib/postgresql/data/pg_hba.conf
echo "listen_addresses='*'" >> /var/lib/postgresql/data/postgresql.conf
# Restart PostgreSQL to apply changes
su - postgres -c "pg_ctl restart -D /var/lib/postgresql/data"