Skip to content

Commit

Permalink
[Docker build] add separate visibility env vars for different db inst…
Browse files Browse the repository at this point in the history
…ance (#2362)
  • Loading branch information
swyxio authored and yiminc committed Jan 12, 2022
1 parent 319861d commit 3c351f2
Showing 1 changed file with 22 additions and 10 deletions.
32 changes: 22 additions & 10 deletions docker/config_template.yaml
Expand Up @@ -33,11 +33,15 @@ persistence:
serverName: {{ default .Env.CASSANDRA_HOST_NAME "" }}
visibility:
cassandra:
hosts: "{{ default .Env.CASSANDRA_SEEDS "" }}"
{{ $visibility_seeds := default .Env.VISIBILITY_CASSANDRA_SEEDS .Env.CASSANDRA_SEEDS }}
{{ $visibility_port := default .Env.VISIBILITY_CASSANDRA_PORT .Env.CASSANDRA_PORT }}
{{ $visibility_user := default .Env.VISIBILITY_CASSANDRA_USER .Env.CASSANDRA_USER }}
{{ $visibility_pwd := default .Env.VISIBILITY_CASSANDRA_PASSWORD .Env.CASSANDRA_PASSWORD }}
hosts: "{{ default $visibility_seeds "" }}"
keyspace: "{{ default .Env.VISIBILITY_KEYSPACE "temporal_visibility" }}"
user: "{{ default .Env.CASSANDRA_USER "" }}"
password: "{{ default .Env.CASSANDRA_PASSWORD "" }}"
port: {{ default .Env.CASSANDRA_PORT "9042" }}
user: "{{ default $visibility_user "" }}"
password: "{{ default $visibility_pwd "" }}"
port: {{ default $visibility_port "9042" }}
maxConns: {{ default .Env.CASSANDRA_MAX_CONNS "10" }}
tls:
enabled: {{ default .Env.CASSANDRA_TLS_ENABLED "false" }}
Expand Down Expand Up @@ -74,12 +78,16 @@ persistence:
serverName: {{ default .Env.SQL_HOST_NAME "" }}
visibility:
sql:
{{ $visibility_seeds := default .Env.VISIBILITY_MYSQL_SEEDS .Env.MYSQL_SEEDS }}
{{ $visibility_port := default .Env.VISIBILITY_DB_PORT .Env.DB_PORT }}
{{ $visibility_user := default .Env.VISIBILITY_MYSQL_USER .Env.MYSQL_USER }}
{{ $visibility_pwd := default .Env.VISIBILITY_MYSQL_PWD .Env.MYSQL_PWD }}
pluginName: "mysql"
databaseName: "{{ default .Env.VISIBILITY_DBNAME "temporal_visibility" }}"
connectAddr: "{{ default .Env.MYSQL_SEEDS "" }}:{{ default .Env.DB_PORT "3306" }}"
connectAddr: "{{ default $visibility_seeds "" }}:{{ default $visibility_port "3306" }}"
connectProtocol: "tcp"
user: "{{ default .Env.MYSQL_USER "" }}"
password: "{{ default .Env.MYSQL_PWD "" }}"
user: "{{ default $visibility_user "" }}"
password: "{{ default $visibility_pwd "" }}"
{{- if .Env.MYSQL_TX_ISOLATION_COMPAT }}
connectAttributes:
tx_isolation: "'READ-COMMITTED'"
Expand Down Expand Up @@ -115,12 +123,16 @@ persistence:
serverName: {{ default .Env.SQL_HOST_NAME "" }}
visibility:
sql:
{{ $visibility_seeds := default .Env.VISIBILITY_POSTGRES_SEEDS .Env.POSTGRES_SEEDS }}
{{ $visibility_port := default .Env.VISIBILITY_DB_PORT .Env.DB_PORT }}
{{ $visibility_user := default .Env.VISIBILITY_POSTGRES_USER .Env.POSTGRES_USER }}
{{ $visibility_pwd := default .Env.VISIBILITY_POSTGRES_PWD .Env.POSTGRES_PWD }}
pluginName: "postgres"
databaseName: "{{ default .Env.VISIBILITY_DBNAME "temporal_visibility" }}"
connectAddr: "{{ default .Env.POSTGRES_SEEDS "" }}:{{ default .Env.DB_PORT "5432" }}"
connectAddr: "{{ default $visibility_seeds "" }}:{{ default $visibility_port "5432" }}"
connectProtocol: "tcp"
user: "{{ default .Env.POSTGRES_USER "" }}"
password: "{{ default .Env.POSTGRES_PWD "" }}"
user: "{{ default $visibility_user "" }}"
password: "{{ default $visibility_pwd "" }}"
maxConns: {{ default .Env.SQL_VIS_MAX_CONNS "10" }}
maxIdleConns: {{ default .Env.SQL_VIS_MAX_IDLE_CONNS "10" }}
maxConnLifetime: {{ default .Env.SQL_VIS_MAX_CONN_TIME "1h" }}
Expand Down

0 comments on commit 3c351f2

Please sign in to comment.