I'm trying to create simple postgres server with docker. I use the official postgres image as a base for my container. My Dockerfile contains these commands:
FROM postgres
USER postgres
RUN /etc/init.d/postgresql start &&\
psql --command "CREATE USER user WITH SUPERUSER PASSWORD 'user';" &&\
createdb -O user app
And when I try to run it I have an error:
psql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
What I'm doing wrong?