Skip to content

Instantly share code, notes, and snippets.

@cybersiddhu
Last active December 20, 2015 07:09
Show Gist options
  • Select an option

  • Save cybersiddhu/6090741 to your computer and use it in GitHub Desktop.

Select an option

Save cybersiddhu/6090741 to your computer and use it in GitHub Desktop.
Dockerfile for pglite
#!/bin/sh
set -e
mkdir /usr/share/zoneinfo /data
chown default /data
head -c 16 /dev/urandom | sha1sum | cut -c1-10 > /pwfile
echo "PG_PASSWORD=$(cat /pwfile)"
su default -s /usr/bin/initdb -- --pgdata=/data --pwfile=/pwfile --username=postgres --auth=trust >/dev/null
echo host all all 0.0.0.0 0.0.0.0 md5 >> /data/pg_hba.conf
exec su default -s /usr/bin/postgres -- -D /data -c 'listen_addresses=*'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment