File tree Expand file tree Collapse file tree 5 files changed +13
-2
lines changed Expand file tree Collapse file tree 5 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,7 @@ dokku postgres:create <service> [--create-flags...]
66
66
flags:
67
67
68
68
- ` -c|--config-options "--args --go=here" ` : extra arguments to pass to the container create command (default: ` None ` )
69
+ - ` -c|--createdb-options "--locale=C" ` : extra arguments to pass to the ` createdb ` command inside the container (default: ` -E=UTF8 ` )
69
70
- ` -C|--custom-env "USER=alpha;HOST=beta" ` : semi-colon delimited environment variables to start the service with
70
71
- ` -i|--image IMAGE ` : the image name to start the service with
71
72
- ` -I|--image-version IMAGE_VERSION ` : the image version to start the service with
Original file line number Diff line number Diff line change @@ -269,6 +269,10 @@ service_commit_config() {
269
269
echo " $SERVICE_MEMORY " > " $SERVICE_ROOT /SERVICE_MEMORY"
270
270
fi
271
271
272
+ if [[ -n " $CREATEDB_OPTIONS " ]]; then
273
+ echo " $CREATEDB_OPTIONS " > " $SERVICE_ROOT /CREATEDB_OPTIONS"
274
+ fi
275
+
272
276
if [[ -n " $SERVICE_SHM_SIZE " ]]; then
273
277
echo " $SERVICE_SHM_SIZE " > " $SERVICE_ROOT /SHM_SIZE"
274
278
fi
@@ -452,6 +456,7 @@ service_info() {
452
456
local flag_map=(
453
457
" --config-dir: ${SERVICE_ROOT} /${PLUGIN_CONFIG_SUFFIX} "
454
458
" --config-options: $( cat " $SERVICE_ROOT /CONFIG_OPTIONS" ) "
459
+ " --createdb-options: $( cat " $SERVICE_ROOT /CREATEDB_OPTIONS" ) "
455
460
" --data-dir: ${SERVICE_ROOT} /data"
456
461
" --dsn: ${SERVICE_URL} "
457
462
" --exposed-ports: $( service_exposed_ports " $SERVICE " ) "
Original file line number Diff line number Diff line change @@ -73,6 +73,10 @@ service_create_container() {
73
73
export CONFIG_OPTIONS=" $( cat " $SERVICE_ROOT /CONFIG_OPTIONS" ) "
74
74
fi
75
75
76
+ if [[ -f " $SERVICE_ROOT /CREATEDB_OPTIONS" ]]; then
77
+ export CREATEDB_OPTIONS=" $( cat " $SERVICE_ROOT /CREATEDB_OPTIONS" ) "
78
+ fi
79
+
76
80
[[ -f " $SERVICE_ROOT /SERVICE_MEMORY" ]] && SERVICE_MEMORY=" $( cat " $SERVICE_ROOT /SERVICE_MEMORY" ) "
77
81
if [[ -n " $SERVICE_MEMORY " ]]; then
78
82
MEMORY_LIMIT=" --memory=${SERVICE_MEMORY} m"
@@ -94,7 +98,7 @@ service_create_container() {
94
98
docker run --rm --link " $SERVICE_NAME :$PLUGIN_COMMAND_PREFIX " " $PLUGIN_WAIT_IMAGE " -p " $PLUGIN_DATASTORE_WAIT_PORT " > /dev/null
95
99
96
100
dokku_log_verbose_quiet " Creating container database"
97
- docker exec " $SERVICE_NAME " su - postgres -c " createdb -E utf8 $DATABASE_NAME " 2> /dev/null || dokku_log_verbose_quiet ' Already exists'
101
+ docker exec " $SERVICE_NAME " su - postgres -c " createdb -E=UTF8 $CREATEDB_OPTIONS $DATABASE_NAME " 2> /dev/null || dokku_log_verbose_quiet ' Already exists'
98
102
99
103
dokku_log_verbose_quiet " Securing connection to database"
100
104
service_stop " $SERVICE " > /dev/null
Original file line number Diff line number Diff line change 1
1
[plugin ]
2
2
description = " dokku postgres service plugin"
3
- version = " 1.14 .1"
3
+ version = " 1.15 .1"
4
4
[plugin .config ]
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ service-create-cmd() {
19
19
# E dokku $PLUGIN_COMMAND_PREFIX:create lollipop
20
20
# A service, service to run command against
21
21
# F -c|--config-options "--args --go=here", extra arguments to pass to the container create command
22
+ # F -c|--createdb-options "--locale=C ", extra arguments to pass to the createdb command inside the container
22
23
# F -C|--custom-env "USER=alpha;HOST=beta", semi-colon delimited environment variables to start the service with
23
24
# F -i|--image IMAGE, the image name to start the service with
24
25
# F -I|--image-version IMAGE_VERSION, the image version to start the service with
You can’t perform that action at this time.
0 commit comments