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=
|
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
|
uses: SpicyPizza/create-envfile@v1
|
||||||
with:
|
with:
|
||||||
envkey_TOKEN: ${{ secrets.TOKEN }}
|
envkey_TOKEN: ${{ secrets.TOKEN }}
|
||||||
|
envkey_DB_HOST: db
|
||||||
- uses: alex-ac/github-action-ssh-docker-compose@master
|
- uses: alex-ac/github-action-ssh-docker-compose@master
|
||||||
name: Docker-Compose Remote Deployment
|
name: Docker-Compose Remote Deployment
|
||||||
with:
|
with:
|
||||||
|
|
|
@ -9,8 +9,9 @@ import org.jetbrains.exposed.sql.transactions.transaction
|
||||||
|
|
||||||
object DatabaseFactory {
|
object DatabaseFactory {
|
||||||
fun init() {
|
fun init() {
|
||||||
|
val host = System.getenv("DB_HOST") ?: "localhost"
|
||||||
val database = Database.connect(
|
val database = Database.connect(
|
||||||
url = "jdbc:pgsql://localhost:5004/schools",
|
url = "jdbc:pgsql://$host:5004/schools",
|
||||||
driver = "com.impossibl.postgres.jdbc.PGDriver",
|
driver = "com.impossibl.postgres.jdbc.PGDriver",
|
||||||
user = "postgres",
|
user = "postgres",
|
||||||
password = "postgres",
|
password = "postgres",
|
||||||
|
|
Loading…
Reference in a new issue