# ensure locale exists in container, you may need to install it
LANG: en_US.UTF-8
+params:
+ db_default_text_search_config: "pb_catelog.english"
+ ## Set db_shared_buffers to 1/3 of the memory you wish to allocate to postgres
+ ## on 1GB install set to 128MB on a 4GB instance you may raise to 1GB
+ # db_shared_buffers: "256MB"
+
# amend SOME_SECRET to a password for the discourse user
hooks:
after_postgres:
- "80:80" # fwd host port 80 to container port 80 (http)
- "2222:22" # fwd host port 2222 to container port 22 (ssh)
-#params:
+params:
+ db_default_text_search_config: "pb_catelog.english"
+ ## Set db_shared_buffers to 1/3 of the memory you wish to allocate to postgres
+ ## on 1GB install set to 128MB on a 4GB instance you may raise to 1GB
+ #db_shared_buffers: "256MB"
+ #
## Which Git revision should this container use? (default: tests-passed)
#version: tests-passed
+params:
+ db_synchronous_commit: "off"
+ db_shared_buffers: "256MB"
+ db_work_mem: "10MB"
+ db_default_text_search_config: "pb_catelog.english"
+
hooks:
after_cron:
- file:
- chown -R postgres:postgres /var/run/postgresql
- exec: /root/upgrade_postgres
+ - exec: rm /root/upgrade_postgres
+
- replace:
filename: "/etc/postgresql/9.3/main/postgresql.conf"
from: "data_directory = '/var/lib/postgresql/9.3/main'"
from: /#?listen_addresses *=.*/
to: "listen_addresses = '*'"
+ # listen on all interfaces
+ - replace:
+ filename: "/etc/postgresql/9.3/main/postgresql.conf"
+ from: /#?listen_addresses *=.*/
+ to: "listen_addresses = '*'"
+
+ # sync commit off is faster and less spiky, also marginally less safe
+ - replace:
+ filename: "/etc/postgresql/9.3/main/postgresql.conf"
+ from: /#?synchronous_commit *=.*/
+ to: "synchronous_commit = $db_synchronous_commit"
+
+ # default is 128MB which is way too small
+ - replace:
+ filename: "/etc/postgresql/9.3/main/postgresql.conf"
+ from: /#?shared_buffers *=.*/
+ to: "shared_buffers = $db_shared_buffers"
+
+ # default is 1MB which is too small
+ - replace:
+ filename: "/etc/postgresql/9.3/main/postgresql.conf"
+ from: /#?work_mem *=.*/
+ to: "work_mem = $db_work_mem"
+
+ # allow for other
+ - replace:
+ filename: "/etc/postgresql/9.3/main/postgresql.conf"
+ from: /#?default_text_search_config *=.*/
+ to: "default_text_search_config = '$db_default_text_search_config'"
+
# Necessary to enable backups
- exec:
cmd: