File tree Expand file tree Collapse file tree 4 files changed +8
-1
lines changed Expand file tree Collapse file tree 4 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,7 @@ dokku postgres:create <service> [--create-flags...]
6666flags:
6767
6868- ` -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 ` )
6970- ` -C|--custom-env "USER=alpha;HOST=beta" ` : semi-colon delimited environment variables to start the service with
7071- ` -i|--image IMAGE ` : the image name to start the service with
7172- ` -I|--image-version IMAGE_VERSION ` : the image version to start the service with
Original file line number Diff line number Diff line change @@ -452,6 +452,7 @@ service_info() {
452452 local flag_map=(
453453 " --config-dir: ${SERVICE_ROOT} /${PLUGIN_CONFIG_SUFFIX} "
454454 " --config-options: $( cat " $SERVICE_ROOT /CONFIG_OPTIONS" ) "
455+ " --createdb-options: $( cat " $SERVICE_ROOT /CREATEDB_OPTIONS" ) "
455456 " --data-dir: ${SERVICE_ROOT} /data"
456457 " --dsn: ${SERVICE_URL} "
457458 " --exposed-ports: $( service_exposed_ports " $SERVICE " ) "
Original file line number Diff line number Diff line change @@ -73,6 +73,10 @@ service_create_container() {
7373 export CONFIG_OPTIONS=" $( cat " $SERVICE_ROOT /CONFIG_OPTIONS" ) "
7474 fi
7575
76+ if [[ -f " $SERVICE_ROOT /CREATEDB_OPTIONS" ]]; then
77+ export CREATEDB_OPTIONS=" $( cat " $SERVICE_ROOT /CREATEDB_OPTIONS" ) "
78+ fi
79+
7680 [[ -f " $SERVICE_ROOT /SERVICE_MEMORY" ]] && SERVICE_MEMORY=" $( cat " $SERVICE_ROOT /SERVICE_MEMORY" ) "
7781 if [[ -n " $SERVICE_MEMORY " ]]; then
7882 MEMORY_LIMIT=" --memory=${SERVICE_MEMORY} m"
@@ -94,7 +98,7 @@ service_create_container() {
9498 docker run --rm --link " $SERVICE_NAME :$PLUGIN_COMMAND_PREFIX " " $PLUGIN_WAIT_IMAGE " -p " $PLUGIN_DATASTORE_WAIT_PORT " > /dev/null
9599
96100 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'
98102
99103 dokku_log_verbose_quiet " Securing connection to database"
100104 service_stop " $SERVICE " > /dev/null
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ service-create-cmd() {
1919 # E dokku $PLUGIN_COMMAND_PREFIX:create lollipop
2020 # A service, service to run command against
2121 # 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
2223 # F -C|--custom-env "USER=alpha;HOST=beta", semi-colon delimited environment variables to start the service with
2324 # F -i|--image IMAGE, the image name to start the service with
2425 # 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