Created
October 10, 2014 04:40
-
-
Save krujos/83b44e59e06eb7c15e67 to your computer and use it in GitHub Desktop.
Dockerfile to build on top of postgres, brittle and gross, but works by more or less reimplementing the entry point.
This file contains hidden or 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
FROM postgres:9.3 | |
MAINTAINER krujos | |
ENV PGDATA /var/lib/postgresql/data #Why do I need this? | |
RUN chown -R postgres "$PGDATA"; gosu postgres initdb; sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf ; { echo; echo 'host all all 0.0.0.0/0 trust'; } >> "$PGDATA"/pg_hba.conf | |
RUN ( chown -R postgres "$PGDATA"; gosu postgres postgres & sleep 2 ; psql -U postgres -c "create user schedule_user;"; psql -U postgres -c "alter user schedule_user password 'schedule_password';"; psql -U postgres -c "create database schedule with owner schedule_user;"; ) | |
ENTRYPOINT ["/docker-entrypoint.sh"] | |
EXPOSE 5432 | |
CMD ["postgres"] | |
#docker run -p 5432:5432 -d schedule-postgres |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Did you figure out why the comment is necessary? It's really bizarre that it does not work without the comment, when all logic says that it should not work with the comment.