1
0
mirror of https://github.com/1C-Company/docker_fresh.git synced 2025-02-01 12:58:03 +02:00
docker_fresh/images/db/entrypoint.sh
2020-04-19 21:56:33 +03:00

16 lines
412 B
Bash

#!/bin/bash
set -e
if [ "$1" = './postgres' ]; then
if [ ! -s "$PGDATA/PG_VERSION" ]; then
chown -R postgres:postgres "$PGDATA"
gosu postgres ./initdb
echo "synchronous_commit = off" >> "$PGDATA/postgresql.conf"
echo "unix_socket_directories = '/tmp,$PGSOCKET'" >> "$PGDATA/postgresql.conf"
fi
chown postgres $PGSOCKET
exec gosu postgres ./postgres
fi
exec "$@"