name: postgresql user: postgres command: postgres -D ${SERVICE_ROOT} -k /tmp/postgresql-${ENVIRONMENT} #stop-command: kill -HUP ${PID} environment-variables: - PGROOT=${SERVICE_ROOT} provides: postgresql ports: postgresql %pre-start name: database directory creation unless-directory: ${SERVICE_ROOT} command: mkdir -p ${SERVICE_ROOT} && chown postgres:postgres ${SERVICE_ROOT} %pre-start name: database creation unless-file: ${SERVICE_ROOT}/base command: su - postgres -c "initdb --locale en_US.UTF-8 -D '${SERVICE_ROOT}'" && rm ${SERVICE_ROOT}/postgresql.conf %pre-start name: database configuration # once this file is created, there is no need to perform the command unless-file: ${SERVICE_ROOT}/postgresql.conf # gen-config inherits its parameters from the environment command: gen-config postgresql.conf ${SERVICE_ROOT}/postgresql.conf && chown postgres:postgres ${SERVICE_ROOT}/postgresql.conf %pre-start name: sockets directory unless-directory: /tmp/postgresql-${ENVIRONMENT} # FIXME: impose permissions command: mkdir -p /tmp/postgresql-${ENVIRONMENT} && chown postgres:postgres /tmp/postgresql-${ENVIRONMENT} # FIXME: add postgresql-pre-start-db-dir around here