Update to use postgres 10.4 by default

This commit is contained in:
Zachary
2018-07-05 01:46:13 -04:00
parent f30db928fb
commit b94af2bf3a
4 changed files with 21 additions and 21 deletions

View File

@@ -1,11 +1,11 @@
# dokku postgres [![Build Status](https://img.shields.io/travis/dokku/dokku-postgres.svg?branch=master "Build Status")](https://travis-ci.org/dokku/dokku-postgres) [![IRC Network](https://img.shields.io/badge/irc-freenode-blue.svg "IRC Freenode")](https://webchat.freenode.net/?channels=dokku) # dokku postgres [![Build Status](https://img.shields.io/travis/dokku/dokku-postgres.svg?branch=master "Build Status")](https://travis-ci.org/dokku/dokku-postgres) [![IRC Network](https://img.shields.io/badge/irc-freenode-blue.svg "IRC Freenode")](https://webchat.freenode.net/?channels=dokku)
Official postgres plugin for dokku. Currently defaults to installing [postgres 10.2](https://hub.docker.com/_/postgres/). Official postgres plugin for dokku. Currently defaults to installing [postgres 10.4](https://hub.docker.com/_/postgres/).
## requirements ## requirements
- dokku 0.4.x+ * dokku 0.4.x+
- docker 1.8.x * docker 1.8.x
## installation ## installation
@@ -58,7 +58,7 @@ dokku postgres:create lolipop
# it *must* be compatible with the # it *must* be compatible with the
# official postgres image # official postgres image
export POSTGRES_IMAGE="postgres" export POSTGRES_IMAGE="postgres"
export POSTGRES_IMAGE_VERSION="10.2" export POSTGRES_IMAGE_VERSION="10.4"
dokku postgres:create lolipop dokku postgres:create lolipop
# you can also specify custom environment # you can also specify custom environment
@@ -172,18 +172,18 @@ believe the postgres is not linked when attempting to use `dokku postgres:unlink
or `dokku postgres:promote`. or `dokku postgres:promote`.
You should be able to fix this by You should be able to fix this by
- Changing DATABASE_URL manually to the new value. * Changing DATABASE_URL manually to the new value.
OR OR
- Set POSTGRES_DATABASE_SCHEME back to its original setting * Set POSTGRES_DATABASE_SCHEME back to its original setting
- Unlink the service * Unlink the service
- Change POSTGRES_DATABASE_SCHEME to the desired setting * Change POSTGRES_DATABASE_SCHEME to the desired setting
- Relink the service * Relink the service
## upgrade/downgrade ## upgrade/downgrade
At the moment a database cant be upgraded (or downgraded) inplace. Instead a clone has to be made, like this: At the moment a database cant be upgraded (or downgraded) inplace. Instead a clone has to be made, like this:
```shell ```shell
# Our original DB using PG 9.5 # Our original DB using PG 9.5
@@ -206,7 +206,7 @@ $ dokku postgres:destroy db9.5
If you wish to tune the postgres instances various .conf files, you can find them by using the postgres:info command. If you wish to tune the postgres instances various .conf files, you can find them by using the postgres:info command.
```shell ```shell
dokku postgres:info lolipop dokku postgres:info lolipop
# or # or
dokku postgres:info lolipop --data-dir dokku postgres:info lolipop --data-dir
``` ```
@@ -243,14 +243,14 @@ dokku postgres:backup-unschedule lolipop
``` ```
Backup auth can also be set up for different regions, signature versions and endpoints (e.g. for minio): Backup auth can also be set up for different regions, signature versions and endpoints (e.g. for minio):
``` ```
# setup s3 backup authentication with different region # setup s3 backup authentication with different region
dokku postgres:backup-auth lolipop AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_REGION dokku postgres:backup-auth lolipop AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_REGION
# setup s3 backup authentication with different signature version and endpoint # setup s3 backup authentication with different signature version and endpoint
dokku postgres:backup-auth lolipop AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_REGION AWS_SIGNATURE_VERSION ENDPOINT_URL dokku postgres:backup-auth lolipop AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_REGION AWS_SIGNATURE_VERSION ENDPOINT_URL
# more specific example for minio auth # more specific example for minio auth
dokku postgres:backup-auth lolipop MINIO_ACCESS_KEY_ID MINIO_SECRET_ACCESS_KEY us-east-1 s3v4 https://YOURMINIOSERVICE dokku postgres:backup-auth lolipop MINIO_ACCESS_KEY_ID MINIO_SECRET_ACCESS_KEY us-east-1 s3v4 https://YOURMINIOSERVICE
``` ```
@@ -266,7 +266,7 @@ dokku postgres:connect db < ./dump.sql
## Security ## Security
The connection to the database is done over SSL. A self-signed certificate is The connection to the database is done over SSL. A self-signed certificate is
automatically generated when creating the service. It can be replaced by a automatically generated when creating the service. It can be replaced by a
custom certificate by overwriting the `server.crt` and `server.key` files in custom certificate by overwriting the `server.crt` and `server.key` files in
`/var/lib/dokku/services/postgres/<DB_NAME>/data`. `/var/lib/dokku/services/postgres/<DB_NAME>/data`.
The `server.key` must be chmoded to 600 and must be owned by the postgres user The `server.key` must be chmoded to 600 and must be owned by the postgres user

2
config
View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
export POSTGRES_IMAGE=${POSTGRES_IMAGE:="postgres"} export POSTGRES_IMAGE=${POSTGRES_IMAGE:="postgres"}
export POSTGRES_IMAGE_VERSION=${POSTGRES_IMAGE_VERSION:="10.2"} export POSTGRES_IMAGE_VERSION=${POSTGRES_IMAGE_VERSION:="10.4"}
export POSTGRES_ROOT=${POSTGRES_ROOT:="/var/lib/dokku/services/postgres"} export POSTGRES_ROOT=${POSTGRES_ROOT:="/var/lib/dokku/services/postgres"}
export POSTGRES_HOST_ROOT=${POSTGRES_HOST_ROOT:=$POSTGRES_ROOT} export POSTGRES_HOST_ROOT=${POSTGRES_HOST_ROOT:=$POSTGRES_ROOT}

View File

@@ -22,7 +22,7 @@ case "$1" in
echo "mongo 3.2.9 12eadb136159 2 days ago 291.1 MB" echo "mongo 3.2.9 12eadb136159 2 days ago 291.1 MB"
echo "mysql 5.7.12 57d56ac47bed 2 days ago 321.3 MB" echo "mysql 5.7.12 57d56ac47bed 2 days ago 321.3 MB"
echo "nats 0.9.4 9216d5a4eec8 2 days ago 109.3 MB" echo "nats 0.9.4 9216d5a4eec8 2 days ago 109.3 MB"
echo "postgres 10.2 6412eb70175e 2 days ago 265.7 MB" echo "postgres 10.4 6412eb70175e 2 days ago 265.7 MB"
echo "rabbitmq 3.6.5-management 327b803301e9 2 days ago 143.5 MB" echo "rabbitmq 3.6.5-management 327b803301e9 2 days ago 143.5 MB"
echo "redis 3.2.3 9216d5a4eec8 2 days ago 109.3 MB" echo "redis 3.2.3 9216d5a4eec8 2 days ago 109.3 MB"
echo "rethinkdb 2.3.4 f27010a550ec 2 days ago 196.3 MB" echo "rethinkdb 2.3.4 f27010a550ec 2 days ago 196.3 MB"
@@ -71,7 +71,7 @@ case "$1" in
echo 'c0f74fc90377 mongo:3.2.9 "/entrypoint.sh mong" 11 seconds ago Up 10 seconds 27017/tcp dokku.mongo.l' echo 'c0f74fc90377 mongo:3.2.9 "/entrypoint.sh mong" 11 seconds ago Up 10 seconds 27017/tcp dokku.mongo.l'
echo '0f33b1c86da9 mysql:5.7.12 "/entrypoint.sh mysq" 11 seconds ago Up 10 seconds 3306/tcp dokku.mysql.l' echo '0f33b1c86da9 mysql:5.7.12 "/entrypoint.sh mysq" 11 seconds ago Up 10 seconds 3306/tcp dokku.mysql.l'
echo '9f10b6dc12d5 nats:0.9.4 "/entrypoint.sh redi" 11 seconds ago Up 10 seconds 4222/tcp dokku.nats.l' echo '9f10b6dc12d5 nats:0.9.4 "/entrypoint.sh redi" 11 seconds ago Up 10 seconds 4222/tcp dokku.nats.l'
echo '7f899b723c08 postgres:10.2 "/docker-entrypoint." 11 seconds ago Up 10 seconds 5432/tcp dokku.postgres.l' echo '7f899b723c08 postgres:10.4 "/docker-entrypoint." 11 seconds ago Up 10 seconds 5432/tcp dokku.postgres.l'
echo '5e50a462661e rabbitmq:3.6.5-management "/docker-entrypoint." 11 seconds ago Up 10 seconds 5672/tcp, 15672/tcp dokku.rabbitmq.l' echo '5e50a462661e rabbitmq:3.6.5-management "/docker-entrypoint." 11 seconds ago Up 10 seconds 5672/tcp, 15672/tcp dokku.rabbitmq.l'
echo 'c39ca00fa3c6 redis:3.2.3 "/entrypoint.sh redi" 11 seconds ago Up 10 seconds 6379/tcp dokku.redis.l' echo 'c39ca00fa3c6 redis:3.2.3 "/entrypoint.sh redi" 11 seconds ago Up 10 seconds 6379/tcp dokku.redis.l'
echo 'dc98c2939a80 rethinkdb:2.3.4 "rethinkdb --bind al" 11 seconds ago Up 10 seconds 8080/tcp, 28015/tcp, 29015/tcp dokku.rethinkdb.l' echo 'dc98c2939a80 rethinkdb:2.3.4 "rethinkdb --bind al" 11 seconds ago Up 10 seconds 8080/tcp, 28015/tcp, 29015/tcp dokku.rethinkdb.l'

View File

@@ -11,20 +11,20 @@ teardown() {
@test "($PLUGIN_COMMAND_PREFIX:list) with no exposed ports, no linked apps" { @test "($PLUGIN_COMMAND_PREFIX:list) with no exposed ports, no linked apps" {
run dokku "$PLUGIN_COMMAND_PREFIX:list" run dokku "$PLUGIN_COMMAND_PREFIX:list"
assert_contains "${lines[*]}" "l postgres:10.2 running - -" assert_contains "${lines[*]}" "l postgres:10.4 running - -"
} }
@test "($PLUGIN_COMMAND_PREFIX:list) with exposed ports" { @test "($PLUGIN_COMMAND_PREFIX:list) with exposed ports" {
dokku "$PLUGIN_COMMAND_PREFIX:expose" l 4242 dokku "$PLUGIN_COMMAND_PREFIX:expose" l 4242
run dokku "$PLUGIN_COMMAND_PREFIX:list" run dokku "$PLUGIN_COMMAND_PREFIX:list"
assert_contains "${lines[*]}" "l postgres:10.2 running 5432->4242 -" assert_contains "${lines[*]}" "l postgres:10.4 running 5432->4242 -"
} }
@test "($PLUGIN_COMMAND_PREFIX:list) with linked app" { @test "($PLUGIN_COMMAND_PREFIX:list) with linked app" {
dokku apps:create my_app dokku apps:create my_app
dokku "$PLUGIN_COMMAND_PREFIX:link" l my_app dokku "$PLUGIN_COMMAND_PREFIX:link" l my_app
run dokku "$PLUGIN_COMMAND_PREFIX:list" run dokku "$PLUGIN_COMMAND_PREFIX:list"
assert_contains "${lines[*]}" "l postgres:10.2 running - my_app" assert_contains "${lines[*]}" "l postgres:10.4 running - my_app"
dokku --force apps:destroy my_app dokku --force apps:destroy my_app
} }