From 01a1eb7f4d943909d10b6f01c41bda33e39cddf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Fri, 16 Apr 2021 11:55:07 +0200 Subject: [PATCH 1/3] Use a maintained PostgreSQL version in Docker Neither PostgreSQL version 9.4 nor version 9.5 are maintained anymore. --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index d6ee7443d..e68332d69 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,7 +5,7 @@ services: # use the preferred version of the official Postgres image # see https://hub.docker.com/_/postgres/ - image: postgres:9.4.5 + image: postgres:9.6.21 # persist the database between containers by storing it in a volume volumes: From 7378d2cd8dbe24e52ced8a09dbd2140ba0401a50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Fri, 16 Apr 2021 11:57:27 +0200 Subject: [PATCH 2/3] Update PostgreSQL dependency to version 9.5 Version 9.4 hasn't been maintained since February 2020, so we aren't supporting it either. And we might start using `UPSERT` instead of `find_or_create`, which was introduced in PostgreSQL 9.5. We're still supporting PostgreSQL 9.5 even if it's also unmaintained because it has only been officially unmaintained for a couple of months. --- README.md | 2 +- README_ES.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4a8266fc6..5a9d5e6e3 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ You can access the main website of the project at [http://consulproject.org](htt **NOTE**: For more detailed instructions check the [docs](https://docs.consulproject.org) -Prerequisites: install git, Ruby 2.6.6, CMake, pkg-config, shared-mime-info, Node.js and PostgreSQL (>=9.4). +Prerequisites: install git, Ruby 2.6.6, CMake, pkg-config, shared-mime-info, Node.js and PostgreSQL (>=9.5). ```bash git clone https://github.com/consul/consul.git diff --git a/README_ES.md b/README_ES.md index 2bf6d1c17..4ee912dea 100644 --- a/README_ES.md +++ b/README_ES.md @@ -36,7 +36,7 @@ Puedes acceder a la página principal del proyecto en [http://consulproject.org] **NOTA**: para unas instrucciones más detalladas consulta la [documentación](https://docs.consulproject.org) -Prerequisitos: tener instalado git, Ruby 2.6.6, CMake, pkg-config, shared-mime-info, Node.js y PostgreSQL (9.4 o superior). +Prerequisitos: tener instalado git, Ruby 2.6.6, CMake, pkg-config, shared-mime-info, Node.js y PostgreSQL (9.5 o superior). ```bash git clone https://github.com/consul/consul.git From a6cda3711397bb8e26657197eaeffaa010c06631 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Thu, 22 Apr 2021 18:08:53 +0200 Subject: [PATCH 3/3] Use environment variable for password in Docker We were getting an error since we started using the postgres 9.6 image: ``` Attaching to app_1, database_1 database_1 | Error: Database is uninitialized and superuser password is not specified. database_1 | You must specify POSTGRES_PASSWORD to a non-empty value for the database_1 | superuser. For example, "-e POSTGRES_PASSWORD=password" on "docker run". database_1 | database_1 | You may also use "POSTGRES_HOST_AUTH_METHOD=trust" to allow all database_1 | connections without a password. This is *not* recommended. database_1 | database_1 | See PostgreSQL documentation about "trust": database_1 | https://www.postgresql.org/docs/current/auth-trust.html ``` --- docker-compose.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index e68332d69..982d5731a 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,7 +6,8 @@ services: # use the preferred version of the official Postgres image # see https://hub.docker.com/_/postgres/ image: postgres:9.6.21 - + environment: + - POSTGRES_PASSWORD=$POSTGRES_PASSWORD # persist the database between containers by storing it in a volume volumes: - docker-example-postgres:/var/lib/postgresql/data @@ -37,6 +38,7 @@ services: - bundle:/usr/local/bundle:delegated - "$SSH_AUTH_SOCK:/tmp/agent.sock" environment: + - POSTGRES_PASSWORD=$POSTGRES_PASSWORD - SSH_AUTH_SOCK=/tmp/agent.sock volumes: docker-example-postgres: {}