1
0
mirror of https://github.com/1C-Company/docker_fresh.git synced 2025-02-07 13:07:54 +02:00
docker_fresh/images/db/entrypoint.sh

16 lines
412 B
Bash
Raw Normal View History

2020-04-05 21:21:05 +03:00
#!/bin/bash
set -e
2020-04-19 21:56:33 +03:00
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
2020-04-05 21:21:05 +03:00
fi
2020-04-19 21:56:33 +03:00
exec "$@"