Skip to content

Commit

Permalink
Try exposing the port and restarting postgres
Browse files Browse the repository at this point in the history
I still can't get the django client to be able to connect to this
instance
  • Loading branch information
dc740 committed Jan 10, 2020
1 parent 9dcf12c commit da98d0e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,17 @@ RUN apt-get update \
RUN pip install --upgrade pip virtualenv

# setup postgresql database and user.
# We don't expose the port, but allow all incomming connections
USER postgres
RUN echo "host all all 0.0.0.0/0 md5" >> /etc/postgresql/11/main/pg_hba.conf
RUN echo "listen_addresses='*'" >> /etc/postgresql/11/main/postgresql.conf
RUN /etc/init.d/postgresql start \
&& psql -c "CREATE USER ctest WITH SUPERUSER PASSWORD 'coveragetest123';ALTER USER ctest CREATEDB;"
RUN service postgresql restart
RUN psql -c "CREATE USER ctest WITH SUPERUSER PASSWORD 'coveragetest123';ALTER USER ctest CREATEDB;"
RUN createdb -O ctest demo
USER root


EXPOSE 5432

COPY entrypoint.sh /
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

0 comments on commit da98d0e

Please sign in to comment.