mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 06:23:38 +00:00
docker: Add postgres docker build with full text search.
This is multi-stage build which first builds tsearch-extras with the current version of postgres and then configs postgres for zulip. The zulip config installs the hunspell dictionaries, stop words file, tsearch-extras, and creates the initial database. **Testing Plan:** 1) `docker-compose up` the existing config. 2) Build the new image 3) Edit docker-compose.yml to use the new image id 4) `docker-compose up` and verify full text search is still working.
This commit is contained in:
committed by
Tim Abbott
parent
495104bd56
commit
24fbd7205d
21
scripts/setup/postgres-create-db
Executable file
21
scripts/setup/postgres-create-db
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
set -x
|
||||
|
||||
# Make sure the current working directory is readable
|
||||
cd /
|
||||
|
||||
DATABASE_CREATE="
|
||||
CREATE USER zulip;
|
||||
ALTER ROLE zulip SET search_path TO zulip,public;
|
||||
CREATE DATABASE zulip OWNER=zulip;
|
||||
\\connect zulip
|
||||
CREATE SCHEMA zulip AUTHORIZATION zulip;
|
||||
CREATE EXTENSION tsearch_extras SCHEMA zulip;
|
||||
"
|
||||
|
||||
if [ -f /.dockerenv ]; then
|
||||
echo "$DATABASE_CREATE" | psql
|
||||
else
|
||||
echo "$DATABASE_CREATE" | su postgres -c psql
|
||||
fi
|
||||
Reference in New Issue
Block a user