mirror of
https://github.com/zulip/zulip.git
synced 2025-11-05 22:43:42 +00:00
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.
22 lines
436 B
Bash
Executable File
22 lines
436 B
Bash
Executable File
#!/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
|