merge postgres dockerfiles
Merge the two files build/postgres/Dockerfile and docker-compose/posgres/Dockerfile. They have the same contents once we add the /wait-for-it script into the build Dockerfile. refs DE-220 flag = none Test plan: - Ensure that ./script/docker_dev_setup.sh works correctly - Ensure that Jenkins builds correctly when using the new PG image Change-Id: I0e39ceb2f1ec7c9eacbe155f98af7fa78b0f9b8c Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/246898 Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> Reviewed-by: Aaron Ogata <aogata@instructure.com> QA-Review: Andrea Cirulli <andrea.cirulli@instructure.com> Product-Review: Ryan Norton <rnorton@instructure.com> Product-Review: Aaron Ogata <aogata@instructure.com>
This commit is contained in:
parent
c6bf858b46
commit
c82cdf7bd5
|
@ -1,40 +0,0 @@
|
|||
ARG POSTGRES=12
|
||||
FROM postgis/postgis:$POSTGRES-2.5
|
||||
|
||||
RUN echo "max_locks_per_transaction = 640" >> /usr/share/postgresql/$PG_MAJOR/postgresql.conf.sample \
|
||||
&& echo "max_stack_depth = 5MB" >> /usr/share/postgresql/$PG_MAJOR/postgresql.conf.sample \
|
||||
&& echo "random_page_cost = 1.0" >> /usr/share/postgresql/$PG_MAJOR/postgresql.conf.sample \
|
||||
&& echo "shared_buffers = 256MB" >> /usr/share/postgresql/$PG_MAJOR/postgresql.conf.sample \
|
||||
&& echo "effective_cache_size = 256MB" >> /usr/share/postgresql/$PG_MAJOR/postgresql.conf.sample
|
||||
|
||||
ENV PG_COLLKEY_VERSION 0.5.1
|
||||
|
||||
RUN apt-get update --quiet=2 \
|
||||
&& apt-get install --quiet=2 \
|
||||
build-essential \
|
||||
ca-certificates \
|
||||
libicu-dev \
|
||||
postgresql-server-dev-$PG_MAJOR \
|
||||
pgxnclient \
|
||||
unzip \
|
||||
&& pgxnclient download --yes --target ~ pg_collkey=${PG_COLLKEY_VERSION} \
|
||||
&& unzip ~/pg_collkey-${PG_COLLKEY_VERSION}.zip -d ~/ \
|
||||
&& cd ~/pg_collkey-${PG_COLLKEY_VERSION} \
|
||||
&& mv Makefile Makefile.orig \
|
||||
&& sed '/^DATA = \$(wildcard/d' Makefile.orig > Makefile \
|
||||
&& make \
|
||||
&& make install \
|
||||
&& cp -v ~/pg_collkey-${PG_COLLKEY_VERSION}/pg_collkey--${PG_COLLKEY_VERSION}.sql /usr/share/postgresql/$PG_MAJOR/extension \
|
||||
&& apt-get remove -qqy \
|
||||
build-essential \
|
||||
ca-certificates \
|
||||
libicu-dev \
|
||||
postgresql-server-dev-$PG_MAJOR \
|
||||
pgxnclient \
|
||||
unzip \
|
||||
&& rm -rf \
|
||||
/var/lib/apt/lists/* \
|
||||
/tmp/* \
|
||||
/var/tmp/*
|
||||
|
||||
COPY /create-dbs.sh /docker-entrypoint-initdb.d/
|
|
@ -1,13 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -o errexit -o errtrace -o nounset -o pipefail -o xtrace
|
||||
|
||||
# install extension on template1 which every new database is built from,
|
||||
# so we don't have to run this more than once
|
||||
psql -v ON_ERROR_STOP=1 --username postgres <<SQL
|
||||
\connect template1;
|
||||
CREATE EXTENSION IF NOT EXISTS pg_trgm SCHEMA public;
|
||||
CREATE EXTENSION IF NOT EXISTS postgis SCHEMA public;
|
||||
CREATE EXTENSION IF NOT EXISTS pg_collkey SCHEMA public;
|
||||
CREATE DATABASE canvas_test
|
||||
SQL
|
Loading…
Reference in New Issue