Fix db host
This commit is contained in:
parent
7607d6a4fc
commit
f071e890ad
3 changed files with 4 additions and 1 deletions
|
@ -1 +1,2 @@
|
|||
TOKEN=
|
||||
DB_HOST=db
|
||||
|
|
1
.github/workflows/deploy.yml
vendored
1
.github/workflows/deploy.yml
vendored
|
@ -14,6 +14,7 @@ jobs:
|
|||
uses: SpicyPizza/create-envfile@v1
|
||||
with:
|
||||
envkey_TOKEN: ${{ secrets.TOKEN }}
|
||||
envkey_DB_HOST: db
|
||||
- uses: alex-ac/github-action-ssh-docker-compose@master
|
||||
name: Docker-Compose Remote Deployment
|
||||
with:
|
||||
|
|
|
@ -9,8 +9,9 @@ import org.jetbrains.exposed.sql.transactions.transaction
|
|||
|
||||
object DatabaseFactory {
|
||||
fun init() {
|
||||
val host = System.getenv("DB_HOST") ?: "localhost"
|
||||
val database = Database.connect(
|
||||
url = "jdbc:pgsql://localhost:5004/schools",
|
||||
url = "jdbc:pgsql://$host:5004/schools",
|
||||
driver = "com.impossibl.postgres.jdbc.PGDriver",
|
||||
user = "postgres",
|
||||
password = "postgres",
|
||||
|
|
Loading…
Reference in a new issue