chore: Define custom docker image for tests

This images is built from the official postgres docker image, but with
updates to optimize the test execution:

- A config file for postgres to increase the performance of the
  test server.
- An initialization script to create a template database with all
  migrations run against it.

There are new make targets to build and publish this docker image.
The image can be pulled with:

    docker pull hashicorpboundary/postgres:13-alpine

To use this image for tests start the container:

    make -C internal/db/docker database-up
This commit is contained in:
Timothy Messier committed 2021-09-09 13:42:00 -04:00
1 parent 811d0b63fd
commit c6cb7c8512
7 files changed
+153

No files matched your search

+6
View File
@@ -0,0 +1,6 @@
FROM postgres:alpine
ADD init-db.sh /docker-entrypoint-initdb.d/00-init-db.sh
ADD postgresql.conf /etc/postgresql/postgresql.conf
CMD ["postgres", "-c", "config_file=/etc/postgresql/postgresql.conf"]