postgresql/Dockerfile.template: Log to syslog
[dockerfile.git] / postgresql / Dockerfile.template
index e7c094be1b9648fc32a048686527eec94cb6149f..2d7c84ce9b4453b61ec7e605ca79d703f521c043 100644 (file)
@@ -32,9 +32,12 @@ RUN yes | emerge --config dev-db/postgresql-server
 VOLUME ["/var/lib/postgresql"]
 
 # Expose PostgreSQL to external network connections
-RUN echo "listen_addresses = '*'"  >> $(echo /etc/postgresql*/postgresql.conf)
+RUN sed -i "s/\(#listen_addresses =.*\)/listen_addresses = '*'\n\1/" /etc/postgresql*/postgresql.conf
 RUN echo host  all  all  0.0.0.0/0  trust >> $(echo /etc/postgresql*/pg_hba.conf)
 
+# Setup logging
+RUN sed -i "s/\(#log_destination =.*\)/log_destination = 'syslog'\n\1/" /etc/postgresql*/postgresql.conf
+
 # Container networking happens automatically
 RUN sed -i 's/need net$/use net/' /etc/init.d/*