52 lines
2.4 KiB
YAML
52 lines
2.4 KiB
YAML
captainVersion: 4
|
|
services:
|
|
$$cap_appname:
|
|
image: postgres:$$cap_postgres_version
|
|
volumes:
|
|
- $$cap_appname-data:/var/lib/postgresql/data
|
|
restart: always
|
|
environment:
|
|
POSTGRES_USER: $$cap_pg_user
|
|
POSTGRES_PASSWORD: $$cap_pg_pass
|
|
POSTGRES_DB: $$cap_pg_db
|
|
POSTGRES_INITDB_ARGS: $$cap_pg_initdb_args
|
|
caproverExtra:
|
|
notExposeAsWebApp: 'true'
|
|
caproverOneClickApp:
|
|
variables:
|
|
- id: $$cap_postgres_version
|
|
label: Version
|
|
defaultValue: '14.5'
|
|
description: Check out their Docker page for the valid tags https://hub.docker.com/r/library/postgres/tags
|
|
validRegex: /^([^\s^\/])+$/
|
|
- id: $$cap_pg_user
|
|
label: Username
|
|
defaultValue: postgres
|
|
validRegex: /.{1,}/
|
|
- id: $$cap_pg_pass
|
|
label: Password
|
|
defaultValue: $$cap_gen_random_hex(16)
|
|
validRegex: /.{1,}/
|
|
- id: $$cap_pg_db
|
|
label: Default Database
|
|
defaultValue: postgres
|
|
validRegex: /.{1,}/
|
|
- id: $$cap_pg_initdb_args
|
|
label: Optional Arguments
|
|
description: >-
|
|
Arguments will be appended to `postgres initdb`.
|
|
Example: `--data-checksums`.
|
|
validRegex: /.{0,}/
|
|
instructions:
|
|
start: |-
|
|
PostgreSQL, often simply Postgres, is an object-relational database management system (ORDBMS) with an emphasis on extensibility and standards-compliance.
|
|
As a database server, its primary function is to store data, securely and supporting best practices, and retrieve it later, as requested by other software applications, be it those on the same computer or those running on another computer across a network (including the Internet).
|
|
It can handle workloads ranging from small single-machine applications to large Internet-facing applications with many concurrent users.
|
|
end: |-
|
|
Postgres is deployed and available as `srv-captain--$$cap_appname:5432` to other apps.
|
|
For example with Node.js: `const client = new Client({ user: '$$cap_pg_user', host: 'srv-captain--$$cap_appname', database: '$$cap_pg_db', password: '$$cap_pg_pass', port: 5432})`
|
|
displayName: PostgreSQL
|
|
isOfficial: true
|
|
description: The PostgreSQL object-relational database system provides reliability and data integrity
|
|
documentation: https://hub.docker.com/_/postgres
|