forked from kartoza/docker-postgis
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathenv-data.sh
137 lines (115 loc) · 2.94 KB
/
env-data.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
#!/usr/bin/env bash
DATADIR="/var/lib/postgresql/${PG_VERSION}/main"
ROOT_CONF="/etc/postgresql/${PG_VERSION}/main"
PG_ENV="$ROOT_CONF/environment"
CONF="$ROOT_CONF/postgresql.conf"
WAL_ARCHIVE="/opt/archivedir"
RECOVERY_CONF="$ROOT_CONF/recovery.conf"
POSTGRES="/usr/lib/postgresql/${PG_VERSION}/bin/postgres"
INITDB="/usr/lib/postgresql/${PG_VERSION}/bin/initdb"
SQLDIR="/usr/share/postgresql/${PG_VERSION}/contrib/postgis-${PGIS_VERSION}/"
SETVARS="POSTGIS_ENABLE_OUTDB_RASTERS=1 POSTGIS_GDAL_ENABLED_DRIVERS=ENABLE_ALL"
LOCALONLY="-c listen_addresses='127.0.0.1'"
PG_BASEBACKUP="/usr/bin/pg_basebackup"
PROMOTE_FILE="/tmp/pg_promote_master"
PGSTAT_TMP="/var/run/postgresql/"
PG_PID="/var/run/postgresql/${PG_VERSION}-main.pid"
# Make sure we have a user set up
if [ -z "${POSTGRES_USER}" ]; then
POSTGRES_USER=docker
fi
if [ -z "${POSTGRES_PASS}" ]; then
POSTGRES_PASS=docker
fi
if [ -z "${POSTGRES_DBNAME}" ]; then
POSTGRES_DBNAME=gis
fi
# SSL mode
if [ -z "${PGSSLMODE}" ]; then
PGSSLMODE=require
fi
# Enable hstore and topology by default
if [ -z "${HSTORE}" ]; then
HSTORE=true
fi
if [ -z "${TOPOLOGY}" ]; then
TOPOLOGY=true
fi
# Replication settings
if [ -z "${REPLICATE_PORT}" ]; then
REPLICATE_PORT=5432
fi
if [ -z "${DESTROY_DATABASE_ON_RESTART}" ]; then
DESTROY_DATABASE_ON_RESTART=true
fi
if [ -z "${PG_MAX_WAL_SENDERS}" ]; then
PG_MAX_WAL_SENDERS=10
fi
if [ -z "${PG_WAL_KEEP_SEGMENTS}" ]; then
PG_WAL_KEEP_SEGMENTS=250
fi
if [ -z "${IP_LIST}" ]; then
IP_LIST='*'
fi
if [ -z "${MAINTAINANCE_WORKERS}" ]; then
MAINTAINANCE_WORKERS=2
fi
if [ -z "${WAL_SIZE}" ]; then
WAL_SIZE=4GB
fi
if [ -z "${MIN_WAL_SIZE}" ]; then
MIN_WAL_SIZE=2048MB
fi
if [ -z "${WAL_SEGSIZE}" ]; then
WAL_SEGSIZE=1024
fi
if [ -z "${CHECK_POINT_TIMEOUT}" ]; then
CHECK_POINT_TIMEOUT=30min
fi
if [ -z "${MAX_WORKERS}" ]; then
MAX_WORKERS=4
fi
if [ -z "${MAINTAINANCE_WORK_MEM}" ]; then
MAINTAINANCE_WORK_MEM=128MB
fi
if [ -z "${SSL_CERT_FILE}" ]; then
SSL_CERT_FILE='/etc/ssl/certs/ssl-cert-snakeoil.pem'
fi
if [ -z "${SSL_KEY_FILE}" ]; then
SSL_KEY_FILE='/etc/ssl/private/ssl-cert-snakeoil.key'
fi
if [ -z "${POSTGRES_MULTIPLE_EXTENSIONS}" ]; then
POSTGRES_MULTIPLE_EXTENSIONS='postgis,hstore,postgis_topology,plv8'
fi
if [ -z "${ALLOW_IP_RANGE}" ]; then
ALLOW_IP_RANGE='0.0.0.0/0'
fi
if [ -z "${DEFAULT_ENCODING}" ]; then
DEFAULT_ENCODING="UTF8"
fi
if [ -z "${DEFAULT_COLLATION}" ]; then
DEFAULT_COLLATION="en_US.UTF-8"
fi
if [ -z "${DEFAULT_CTYPE}" ]; then
DEFAULT_CTYPE="en_US.UTF-8"
fi
if [ -z "${REPLICATION_USER}" ]; then
REPLICATION_USER=replicator
fi
if [ -z "${REPLICATION_PASS}" ]; then
REPLICATION_PASS=replicator
fi
if [ -z "$EXTRA_CONF" ]; then
EXTRA_CONF=""
fi
# Compatibility with official postgres variable
# Official postgres variable gets priority
if [ ! -z "${POSTGRES_PASSWORD}" ]; then
POSTGRES_PASS=${POSTGRES_PASSWORD}
fi
if [ ! -z "${PGDATA}" ]; then
DATADIR=${PGDATA}
fi
if [ ! -z "$POSTGRES_DB" ]; then
POSTGRES_DBNAME=${POSTGRES_DB}
fi