2019-08-10 17:16:24 +02:00
|
|
|
name: postgresql
|
|
|
|
user: postgres
|
2019-11-08 14:36:59 +01:00
|
|
|
command: postgres -D ${SERVICE_ROOT}/db -k /tmp/postgresql-${ENVIRONMENT}
|
2019-08-10 17:16:24 +02:00
|
|
|
#stop-command: kill -HUP ${PID}
|
|
|
|
environment-variables:
|
2019-11-08 14:36:59 +01:00
|
|
|
- PGROOT=${SERVICE_ROOT}
|
2019-10-24 15:54:15 +02:00
|
|
|
provides: postgresql
|
2019-10-29 12:32:49 +01:00
|
|
|
ports: postgresql
|
2019-08-10 17:16:24 +02:00
|
|
|
|
2019-11-08 14:36:59 +01:00
|
|
|
#%file db
|
|
|
|
# name: database directory
|
|
|
|
# command: mkdir -p db && chown postgres:postgres db
|
2019-08-10 17:16:24 +02:00
|
|
|
|
2019-11-08 14:36:59 +01:00
|
|
|
%file db
|
|
|
|
name: database creation
|
|
|
|
creation-command: mkdir db && chown postgres:postgres db && su - postgres -c "initdb --locale en_US.UTF-8 -D '${SERVICE_ROOT}/db'" && rm db/postgresql.conf
|
|
|
|
#export-command: FIXME
|
2019-10-22 18:33:51 +02:00
|
|
|
|
2019-11-08 14:36:59 +01:00
|
|
|
%configuration db/postgresql.conf
|
|
|
|
# gen-config inherits its parameters from the environment
|
|
|
|
creation-command: gen-config postgresql.conf ${SERVICE_ROOT}/postgresql.conf && chown postgres:postgres ${SERVICE_ROOT}/postgresql.conf
|
2019-08-10 17:16:24 +02:00
|
|
|
|
2019-11-08 14:36:59 +01:00
|
|
|
%file /tmp/${SERVICE_NAME}-${ENVIRONMENT}
|
|
|
|
name: sockets directory
|
|
|
|
unless-directory: /tmp/${SERVICE_NAME}-${ENVIRONMENT}
|
|
|
|
# FIXME: impose permissions
|
|
|
|
command: mkdir -p /tmp/${SERVICE_NAME}-${ENVIRONMENT} && chown postgres:postgres /tmp/${SERVICE_NAME}-${ENVIRONMENT}
|
|
|
|
# FIXME: add postgresql-pre-start-db-dir around here
|