aboutsummaryrefslogtreecommitdiffstats
path: root/build/test/db-test.Dockerfile
blob: cd6161e18213a0c3e44040d3c16cc3887f3db15c (plain)
1
2
3
4
5
6
7
8
9
FROM debian:jessie
RUN apt-get update && apt-get install -y postgresql-9.4
ADD 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 schema.sql /schema.sql
RUN service postgresql start && su postgres -c "cat /schema.sql | psql nms" && service postgresql stop
CMD pg_ctlcluster --foreground 9.4 main start
EXPOSE 5432