Postgres updates (#768)

* Update default postgres version to latest 14.x

* Fix variable references in template

* Use postgres defaults as one-click defaults

* Don't postfix user-given app name with "-db"
This commit is contained in:
Matthew Francis Brunetti 2022-10-17 21:50:27 -04:00 committed by GitHub
parent 296c7de1a8
commit d096b84661
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -1,9 +1,9 @@
captainVersion: 4 captainVersion: 4
services: services:
$$cap_appname-db: $$cap_appname:
image: postgres:$$cap_postgres_version image: postgres:$$cap_postgres_version
volumes: volumes:
- $$cap_appname-db-data:/var/lib/postgresql/data - $$cap_appname-data:/var/lib/postgresql/data
restart: always restart: always
environment: environment:
POSTGRES_USER: $$cap_pg_user POSTGRES_USER: $$cap_pg_user
@ -16,11 +16,12 @@ caproverOneClickApp:
variables: variables:
- id: $$cap_postgres_version - id: $$cap_postgres_version
label: Postgres Version label: Postgres Version
defaultValue: '14.1' defaultValue: '14.5'
description: Check out their Docker page for the valid tags https://hub.docker.com/r/library/postgres/tags/ description: Check out their Docker page for the valid tags https://hub.docker.com/r/library/postgres/tags/
validRegex: /^([^\s^\/])+$/ validRegex: /^([^\s^\/])+$/
- id: $$cap_pg_user - id: $$cap_pg_user
label: Postgres Username label: Postgres Username
defaultValue: postgres
description: '' description: ''
validRegex: /.{1,}/ validRegex: /.{1,}/
- id: $$cap_pg_pass - id: $$cap_pg_pass
@ -29,6 +30,7 @@ caproverOneClickApp:
validRegex: /.{1,}/ validRegex: /.{1,}/
- id: $$cap_pg_db - id: $$cap_pg_db
label: Postgres Default Database label: Postgres Default Database
defaultValue: postgres
description: '' description: ''
validRegex: /.{1,}/ validRegex: /.{1,}/
- id: $$cap_pg_initdb_args - id: $$cap_pg_initdb_args
@ -42,7 +44,7 @@ caproverOneClickApp:
After installation on CapRover, it will be available as srv-captain--YOUR_CONTAINER_NAME at port 5432 to other CapRover apps. After installation on CapRover, it will be available as srv-captain--YOUR_CONTAINER_NAME at port 5432 to other CapRover apps.
Enter your Postgres Configuration parameters and click on next. It will take about a minute for the process to finish. Enter your Postgres Configuration parameters and click on next. It will take about a minute for the process to finish.
end: "Postgres is deployed and available as srv-captain--$$cap_appname-db:5432 to other apps. For example with NodeJS: 'const client = new Client({ user: 'cap_pg_user', host: 'srv-captain--$$cap_appname', database: 'cap_pg_db', password: '********', port: 5432})'" end: "Postgres is deployed and available as srv-captain--$$cap_appname:5432 to other apps. For example with NodeJS: 'const client = new Client({ user: '$$cap_pg_user', host: 'srv-captain--$$cap_appname', database: '$$cap_pg_db', password: '********', port: 5432})'"
displayName: PostgreSQL displayName: PostgreSQL
isOfficial: true isOfficial: true
description: The PostgreSQL object-relational database system provides reliability and data integrity description: The PostgreSQL object-relational database system provides reliability and data integrity