Skip to main content

Connect PostgreSQL database

Codefi Orchestrate uses PostgreSQL as Database Management System. Follow these steps to configure it when starting the Orchestrate Gateway API.

tip

Configure each microservice using microservice-specific environment variables. Command line options are also available and take precedence over environment variables.

Configuration

Environment VariableCommand line optionDescriptionDefault
API_STORE_TYPEapi-store-typeType of database to usepostgres
DB_USERdb-userPostgreSQL userpostgres
DB_PASSWORDdb-passwordPostgreSQL passwordpostgres
DB_DATABASEdb-databaseName of the PostgreSQL databasepostgres
DB_HOSTdb-hostURL of the running PostgreSQL instance127.0.0.1
DB_PORTdb-portName of the PostgreSQL database5432
DB_POOLSIZEdb-poolsizeSize of the pool0
DB_POOL_TIMEOUTdb-pool-timeoutDuration in seconds for which client waits for a free connection if all connections are busy30s
DB_KEEPALIVEdb-keepaliveDuration in seconds of the tcp_keepalives_interval60s

SSL/TLS Configuration

In addition to the options above, follow these steps to configure Postgres over TLS communication. Codefi Orchestrate supports the following modes for SSL/TLS, see the official documentation for more details:

  • disable: I don't care about security, and I don't want to pay the overhead of encryption.
  • require: I want my data to be encrypted, and I accept the overhead. I trust that the network will make sure I always connect to the server I want.
  • verify-ca: I want my data encrypted, and I accept the overhead. I want to be sure I connect to a server that I trust.
  • verify-full: I want my data encrypted, and I accept the overhead. I want to be sure I connect to a server I trust, and that it's the one I specify.
Environment VariableCommand line optionDescriptionDefault
DB_TLS_SSLMODEdb-sslmodeWhich SSL mode to use (see values above)disable
DB_TLS_CERTdb-tls-certTLS certificate
DB_TLS_KEYdb-tls-keyTLS Private Key
DB_TLS_CAdb-tls-caTrusted Certificate Authority