Disassembler
ce325cf3d0
- Bump basic OS to Alpine 3.9 - Restructure repo and add layer versioning - Use JSON for all metadata - Merge abuild branch (but without abuild)
25 lines
745 B
Bash
Executable File
25 lines
745 B
Bash
Executable File
#!/bin/sh
|
|
set -ev
|
|
|
|
cd $(realpath $(dirname "${0}"))/install
|
|
|
|
# Create Postgres instance
|
|
mkdir -p /srv/postgres/data
|
|
chown -R 5432:5432 /srv/postgres/data
|
|
chmod 700 /srv/postgres/data
|
|
lxc-execute -n postgres -- initdb -D /var/lib/postgresql
|
|
|
|
# Configure Postgres
|
|
cp srv/postgres/data/postgresql.conf /srv/postgres/data/postgresql.conf
|
|
cp srv/postgres/data/pg_hba.conf /srv/postgres/data/pg_hba.conf
|
|
|
|
# Enable query logging. Only if the DEBUG environment variable is set
|
|
if [ ${DEBUG:-0} -eq 1 ]; then
|
|
sed -i 's/^#log_destination/log_destination/' /srv/postgres/data/postgresql.conf
|
|
sed -i 's/^#log_statement/log_statement/' /srv/postgres/data/postgresql.conf
|
|
fi
|
|
|
|
# Install service
|
|
cp etc/init.d/postgres /etc/init.d/postgres
|
|
rc-update -u
|