Created
August 11, 2019 01:23
-
-
Save bfatemi/f9e43c58d2196b6a7ecf6c3d2b1bf69a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
## POSTGRES LITE DOCKERFILE- create db, user/pwd, and open listening | |
## | |
FROM postgres:11.1-alpine | |
ADD ./init.sh /docker-entrypoint-initdb.d/. | |
ENV PGDATA /var/lib/postgresql/data | |
EXPOSE 5432 | |
USER postgres | |
RUN mkdir -p $PGDATA && chmod 0700 $PGDATA &&\ | |
initdb \ | |
--allow-group-access \ | |
--encoding=UTF8 \ | |
--pgdata=$PGDATA \ | |
--auth=trust \ | |
--auth-host=trust \ | |
--auth-local=trust &&\ | |
echo "host all all 0.0.0.0/0 md5" >> $PGDATA/pg_hba.conf &&\ | |
echo "listen_addresses='*'" >> $PGDATA/postgresql.conf &&\ | |
pg_ctl -D $PGDATA start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment