diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2018-09-06 12:26:06 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2018-09-06 14:28:09 +0200 |
commit | 76dcf6a13c5736ec15fb31fbc19c9eb8dee803a0 (patch) | |
tree | 9edbe57876d921f229657d712da048b0e515850e /postgresql/docker-entrypoint.sh | |
parent | a8cf191126eaf8271113958f29dcf8783b294420 (diff) | |
download | gitlab-alpine-76dcf6a13c5736ec15fb31fbc19c9eb8dee803a0.tar.bz2 gitlab-alpine-76dcf6a13c5736ec15fb31fbc19c9eb8dee803a0.tar.xz |
initial build of gitlab image
Diffstat (limited to 'postgresql/docker-entrypoint.sh')
-rwxr-xr-x | postgresql/docker-entrypoint.sh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/postgresql/docker-entrypoint.sh b/postgresql/docker-entrypoint.sh new file mode 100755 index 0000000..c438de9 --- /dev/null +++ b/postgresql/docker-entrypoint.sh @@ -0,0 +1,23 @@ +#!/bin/sh -e + +_su(){ + su-exec postgres "$@" +} + +if ! [ -s "$PGDATA"/PG_VERSION ]; then + echo "Initializing database" + _su initdb --username=postgres + + _su pg_ctl -D "$PGDATA" \ + -o "-c listen_addresses=''" \ + -w start + + # create database for gitlab + _su psql -c "CREATE USER git CREATEDB;" + _su psql -c "CREATE EXTENSION IF NOT EXISTS pg_trgm;" + _su psql -c "CREATE DATABASE gitlabhq_production OWNER git;" + + _su pg_ctl -D "$PGDATA" -m fast -w stop +fi + +_su "$@" |