File tree Expand file tree Collapse file tree 7 files changed +797
-26
lines changed
Expand file tree Collapse file tree 7 files changed +797
-26
lines changed Original file line number Diff line number Diff line change @@ -27,14 +27,17 @@ EVENT_EMITTER_MAX_LISTENERS=50
2727# If you don't even want an expiration, enter the value false
2828DEL_INSTANCE = false
2929
30- # Provider: postgresql | mysql
30+ # Provider: postgresql | mysql | psql_bouncer
3131DATABASE_PROVIDER = postgresql
32- DATABASE_CONNECTION_URI = ' postgresql://user:pass@postgres:6543/evolution_db?pgbouncer=true&schema=evolution_api'
33- DATABASE_DIRECT_CONNECTION_URI = postgresql://user:pass@postgres:5432/evolution_db?schema=evolution_api
32+ DATABASE_CONNECTION_URI = ' postgresql://user:pass@postgres:5432/evolution_db?schema=evolution_api'
3433# Client name for the database connection
3534# It is used to separate an API installation from another that uses the same database.
3635DATABASE_CONNECTION_CLIENT_NAME = evolution_exchange
3736
37+ # Bouncer connection: used only when the database provider is set to 'psql_bouncer'.
38+ # Defines the PostgreSQL URL with pgbouncer enabled (pgbouncer=true).
39+ # DATABASE_BOUNCER_CONNECTION_URI=postgresql://user:pass@pgbouncer:5432/evolution_db?pgbouncer=true&schema=evolution_api
40+
3841# Choose the data you want to save in the application's database
3942DATABASE_SAVE_DATA_INSTANCE = true
4043DATABASE_SAVE_DATA_NEW_MESSAGE = true
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ if [ "$DOCKER_ENV" != "true" ]; then
66 export_env_vars
77fi
88
9- if [[ " $DATABASE_PROVIDER " == " postgresql" || " $DATABASE_PROVIDER " == " mysql" ]]; then
9+ if [[ " $DATABASE_PROVIDER " == " postgresql" || " $DATABASE_PROVIDER " == " mysql" || " $DATABASE_PROVIDER " == " psql_bouncer " ]]; then
1010 export DATABASE_URL
1111 echo " Deploying migrations for $DATABASE_PROVIDER "
1212 echo " Database URL: $DATABASE_URL "
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ if [ "$DOCKER_ENV" != "true" ]; then
66 export_env_vars
77fi
88
9- if [[ " $DATABASE_PROVIDER " == " postgresql" || " $DATABASE_PROVIDER " == " mysql" ]]; then
9+ if [[ " $DATABASE_PROVIDER " == " postgresql" || " $DATABASE_PROVIDER " == " mysql" || " $DATABASE_PROVIDER " == " psql_bouncer " ]]; then
1010 export DATABASE_URL
1111 echo " Generating database for $DATABASE_PROVIDER "
1212 echo " Database URL: $DATABASE_URL "
@@ -20,4 +20,4 @@ if [[ "$DATABASE_PROVIDER" == "postgresql" || "$DATABASE_PROVIDER" == "mysql" ]]
2020else
2121 echo " Error: Database provider $DATABASE_PROVIDER invalid."
2222 exit 1
23- fi
23+ fi
Original file line number Diff line number Diff line change @@ -54,22 +54,22 @@ services:
5454 volumes :
5555 - postgres_data:/var/lib/postgresql/data
5656
57- pgbouncer :
58- image : edoburu/pgbouncer:latest
59- environment :
60- DB_HOST : postgres
61- DB_USER : user
62- DB_PASSWORD : pass
63- POOL_MODE : transaction
64- AUTH_TYPE : trust
65- MAX_CLIENT_CONN : 1000
66- DEFAULT_POOL_SIZE : 25
67- depends_on :
68- - postgres
69- ports :
70- - " 6543:5432"
71- networks :
72- - evolution-net
57+ # pgbouncer:
58+ # image: edoburu/pgbouncer:latest
59+ # environment:
60+ # DB_HOST: postgres
61+ # DB_USER: user
62+ # DB_PASSWORD: pass
63+ # POOL_MODE: transaction
64+ # AUTH_TYPE: trust
65+ # MAX_CLIENT_CONN: 1000
66+ # DEFAULT_POOL_SIZE: 25
67+ # depends_on:
68+ # - postgres
69+ # ports:
70+ # - "6543:5432"
71+ # networks:
72+ # - evolution-net
7373
7474volumes :
7575 evolution_instances :
Original file line number Diff line number Diff line change @@ -9,9 +9,8 @@ generator client {
99}
1010
1111datasource db {
12- provider = " postgresql "
13- url = env (" DATABASE_CONNECTION_URI " )
14- directUrl = env (" DATABASE_DIRECT_CONNECTION_URI " )
12+ provider = " postgresql "
13+ url = env (" DATABASE_CONNECTION_URI " )
1514}
1615
1716enum InstanceConnectionStatus {
You can’t perform that action at this time.
0 commit comments