aboutsummaryrefslogtreecommitdiffstats
path: root/build/test/nms-db-test.Dockerfile
blob: 2e0e0cea14f7ae839a3f42ef6640d28ad57313df (plain)
1
2
3
4
5
6
7
8
9
10
FROM debian:jessie
RUN apt-get update && apt-get install -y postgresql-9.4
ADD build/test/pg_hba.tail /pg_hba.tail
RUN cat /pg_hba.tail >> /etc/postgresql/9.4/main/pg_hba.conf
RUN service postgresql start && su postgres -c "psql --command=\"CREATE ROLE nms PASSWORD 'risbrod' NOSUPERUSER NOCREATEDB NOCREATEROLE INHERIT LOGIN;\"" && su postgres -c "createdb -O nms nms" && service postgresql stop
ADD build/schema.sql /schema.sql
RUN service postgresql start && su postgres -c "cat /schema.sql | psql nms" && service postgresql stop
RUN echo "listen_addresses = '*'" >> /etc/postgresql/9.4/main/postgresql.conf
CMD pg_ctlcluster --foreground 9.4 main start
EXPOSE 5432