diff --git a/database/Dockerfile b/database/Dockerfile new file mode 100644 index 000000000..ef8ece592 --- /dev/null +++ b/database/Dockerfile @@ -0,0 +1,9 @@ +FROM crunchydata/crunchy-postgres-gis:centos7-12.2-4.2.2 + +# Copy startup scripts +COPY /* /docker-entrypoint-initdb.d/ + +# User, port and Healthcheck +USER postgres +EXPOSE 5432 +HEALTHCHECK --interval=5s --timeout=5s --retries=5 CMD [ "pg_isready", "-U", "postgres"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index ac45fe7ec..d419e4ea2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -50,9 +50,7 @@ services: ############################################################################################# db: platform: linux/x86_64 - build: - context: ./database - dockerfile: Dockerfile + image: crunchydata/crunchy-postgres-gis:centos7-12.2-4.2.2 hostname: db environment: PG_USER: gwells @@ -76,7 +74,7 @@ services: - "5432:5432" volumes: - /pgdata - # - ./database/scripts/local_dev/setup.sql:/pgconf/setup.sql + - ./database/scripts/local_dev/setup.sql:/pgconf/setup.sql healthcheck: test: ["CMD-SHELL", "/usr/pgsql-12/bin/pg_isready", "-d", "gwells"] interval: 20s