|
| 1 | +config :realtime_server, RealtimeServer.Repo, |
| 2 | + # Primary database configuration |
| 3 | + username: System.get_env("PRIMARY_DB_USERNAME"), |
| 4 | + password: System.get_env("PRIMARY_DB_PASSWORD"), |
| 5 | + database: System.get_env("PRIMARY_DB_NAME"), |
| 6 | + hostname: System.get_env("PRIMARY_DB_HOST"), |
| 7 | + port: String.to_integer(System.get_env("PRIMARY_DB_PORT", "3306")), |
| 8 | + pool_size: String.to_integer(System.get_env("POOL_SIZE", "10")), |
| 9 | + ssl: true, |
| 10 | + ssl_opts: [ |
| 11 | + verify: :verify_peer, |
| 12 | + cacertfile: System.get_env("DB_CA_CERT"), |
| 13 | + server_name_indication: to_charlist(System.get_env("PRIMARY_DB_HOST")) |
| 14 | + ], |
| 15 | + # Read replica configuration |
| 16 | + replicas: [ |
| 17 | + [ |
| 18 | + username: System.get_env("REPLICA_1_DB_USERNAME"), |
| 19 | + password: System.get_env("REPLICA_1_DB_PASSWORD"), |
| 20 | + database: System.get_env("REPLICA_1_DB_NAME"), |
| 21 | + hostname: System.get_env("REPLICA_1_DB_HOST"), |
| 22 | + port: String.to_integer(System.get_env("REPLICA_1_DB_PORT", "3306")), |
| 23 | + ssl: true, |
| 24 | + ssl_opts: [ |
| 25 | + verify: :verify_peer, |
| 26 | + cacertfile: System.get_env("DB_CA_CERT"), |
| 27 | + server_name_indication: to_charlist(System.get_env("REPLICA_1_DB_HOST")) |
| 28 | + ] |
| 29 | + ], |
| 30 | + [ |
| 31 | + username: System.get_env("REPLICA_2_DB_USERNAME"), |
| 32 | + password: System.get_env("REPLICA_2_DB_PASSWORD"), |
| 33 | + database: System.get_env("REPLICA_2_DB_NAME"), |
| 34 | + hostname: System.get_env("REPLICA_2_DB_HOST"), |
| 35 | + port: String.to_integer(System.get_env("REPLICA_2_DB_PORT", "3306")), |
| 36 | + ssl: true, |
| 37 | + ssl_opts: [ |
| 38 | + verify: :verify_peer, |
| 39 | + cacertfile: System.get_env("DB_CA_CERT"), |
| 40 | + server_name_indication: to_charlist(System.get_env("REPLICA_2_DB_HOST")) |
| 41 | + ] |
| 42 | + ] |
| 43 | + ] |
0 commit comments