Skip to content

Commit 55359cf

Browse files
author
Simon Wacker
committed
Pass database information via environment variables instead of appsettings to put them in the same file with the corresponding definitions in the database service
1 parent 6afb6d7 commit 55359cf

File tree

5 files changed

+5
-10
lines changed

5 files changed

+5
-10
lines changed

backend/src/appsettings.development.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,5 @@
66
"MinimumLevel": {
77
"Default": "Verbose"
88
}
9-
},
10-
"Database": {
11-
"ConnectionString": "Host=database; Port=5432; Database=xbase; User Id=postgres; Password=postgres; Maximum Pool Size=90;"
129
}
1310
}

backend/src/appsettings.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
{
2-
"AllowedHosts": "*",
3-
"Database": {
4-
"SchemaName": "metabase"
5-
}
2+
"AllowedHosts": "*"
63
}

backend/src/appsettings.production.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,5 @@
1313
"System": "Error"
1414
}
1515
}
16-
},
17-
"Database": {
18-
"ConnectionString": "Host=database; Port=5432; Database=xbase; User Id=postgres; Passfile=/run/secrets/postgres_passwords; Maximum Pool Size=90;"
1916
}
2017
}

docker-compose.production.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ services:
7373
XBASE_Host: "https://${HOST:?required}"
7474
XBASE_BootstrapUserPassword: "${BOOTSTRAP_USER_PASSWORD:?required}"
7575
XBASE_OpenIdConnectClientSecret: "${OPEN_ID_CONNECT_CLIENT_SECRET:?required}"
76+
XBASE_Database__SchemaName: "metabase"
77+
XBASE_Database__ConnectionString: "Host=database; Port=5432; Database=xbase; User Id=postgres; Passfile=/run/secrets/postgres_passwords; Maximum Pool Size=90;"
7678
XBASE_JsonWebToken__EncryptionCertificatePassword: "${JSON_WEB_TOKEN_ENCRYPTION_CERTIFICATE_PASSWORD:?required}"
7779
XBASE_JsonWebToken__SigningCertificatePassword: "${JSON_WEB_TOKEN_SIGNING_CERTIFICATE_PASSWORD:?required}"
7880
XBASE_Email__SmtpHost: "${SMTP_HOST:?required}"

docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ services:
9999
XBASE_Host: "https://${HOST:?required}:${HTTPS_PORT:?required}"
100100
XBASE_BootstrapUserPassword: "${BOOTSTRAP_USER_PASSWORD:?required}"
101101
XBASE_OpenIdConnectClientSecret: "${OPEN_ID_CONNECT_CLIENT_SECRET:?required}"
102+
XBASE_Database__SchemaName: "metabase"
103+
XBASE_Database__ConnectionString: "Host=database; Port=5432; Database=xbase; User Id=postgres; Password=postgres; Maximum Pool Size=90;"
102104
XBASE_JsonWebToken__EncryptionCertificatePassword: "${JSON_WEB_TOKEN_ENCRYPTION_CERTIFICATE_PASSWORD:?required}"
103105
XBASE_JsonWebToken__SigningCertificatePassword: "${JSON_WEB_TOKEN_SIGNING_CERTIFICATE_PASSWORD:?required}"
104106
XBASE_Email__SmtpHost: "${SMTP_HOST:?required}"

0 commit comments

Comments
 (0)