我创建了一个名为 job-board 的服务,我希望它运行并与 postgres 容器对话。我不确定是否应该使用 sbt 运行工作板?或者我应该使用 docker-compose up 来使用 Docker 运行这两个服务?
您何时使用 SBT 运行以及何时在容器中运行?
我不断收到以下连接错误,我尝试过使用连接网址,但没有运气。
我不确定 application.config 在所有这些中扮演的角色以及它与 dockerFile 和 docker-compose 的关系。
如果您需要更多详细信息,这里是 github 存储库:https ://github.com/fullStackRyan/job-board
Starting job-board_postgres_1 ... done
Starting job-board_job-board_1 ... done
Attaching to job-board_postgres_1, job-board_job-board_1
postgres_1 |
postgres_1 | PostgreSQL Database directory appears to contain a database; Skipping initialization
postgres_1 |
postgres_1 | 2020-08-13 10:57:43.540 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
postgres_1 | 2020-08-13 10:57:43.540 UTC [1] LOG: listening on IPv6 address "::", port 5432
postgres_1 | 2020-08-13 10:57:43.542 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
postgres_1 | 2020-08-13 10:57:43.555 UTC [21] LOG: database system was shut down at 2020-08-13 10:57:29 UTC
postgres_1 | 2020-08-13 10:57:43.557 UTC [1] LOG: database system is ready to accept connections
job-board_1 | [info] welcome to sbt 1.3.13 (Oracle Corporation Java 1.8.0_222)
job-board_1 | [info] loading project definition from /usr/src/job-board/project
job-board_1 | [info] loading settings for project job-board from build.sbt ...
job-board_1 | [info] set current project to job-board (in build file:/usr/src/job-board/)
job-board_1 | [warn] insecure HTTP request is deprecated 'http://repo.typesafe.com/typesafe/releases/'; switch to HTTPS or opt-in as ("Typesafe repository" at "http://repo.typesafe.com/typesafe/releases/").withAllowInsecureProtocol(true)
job-board_1 | [info] running io.github.jobboard.Main
job-board_1 | 10:57:57.456 [ForkJoinPool-1-worker-13] DEBUG com.zaxxer.hikari.HikariConfig - HikariPool-1 - configuration:
job-board_1 | 10:57:57.468 [ForkJoinPool-1-worker-13] DEBUG com.zaxxer.hikari.HikariConfig - allowPoolSuspension.............false
job-board_1 | 10:57:57.468 [ForkJoinPool-1-worker-13] DEBUG com.zaxxer.hikari.HikariConfig - autoCommit......................true
job-board_1 | 10:57:57.468 [ForkJoinPool-1-worker-13] DEBUG com.zaxxer.hikari.HikariConfig - catalog.........................none
job-board_1 | 10:57:57.469 [ForkJoinPool-1-worker-13] DEBUG com.zaxxer.hikari.HikariConfig - connectionInitSql...............none
job-board_1 | 10:57:57.469 [ForkJoinPool-1-worker-13] DEBUG com.zaxxer.hikari.HikariConfig - connectionTestQuery.............none
job-board_1 | 10:57:57.469 [ForkJoinPool-1-worker-13] DEBUG com.zaxxer.hikari.HikariConfig - connectionTimeout...............30000
job-board_1 | 10:57:57.470 [ForkJoinPool-1-worker-13] DEBUG com.zaxxer.hikari.HikariConfig - dataSource......................none
job-board_1 | 10:57:57.470 [ForkJoinPool-1-worker-13] DEBUG com.zaxxer.hikari.HikariConfig - dataSourceClassName.............none
job-board_1 | 10:57:57.470 [ForkJoinPool-1-worker-13] DEBUG com.zaxxer.hikari.HikariConfig - dataSourceJNDI..................none
job-board_1 | 10:57:57.471 [ForkJoinPool-1-worker-13] DEBUG com.zaxxer.hikari.HikariConfig - dataSourceProperties............{password=<masked>}
job-board_1 | 10:57:57.471 [ForkJoinPool-1-worker-13] DEBUG com.zaxxer.hikari.HikariConfig - driverClassName.................none
job-board_1 | 10:57:57.471 [ForkJoinPool-1-worker-13] DEBUG com.zaxxer.hikari.HikariConfig - healthCheckProperties...........{}
job-board_1 | 10:57:57.472 [ForkJoinPool-1-worker-13] DEBUG com.zaxxer.hikari.HikariConfig - healthCheckRegistry.............none
job-board_1 | 10:57:57.472 [ForkJoinPool-1-worker-13] DEBUG com.zaxxer.hikari.HikariConfig - idleTimeout.....................600000
job-board_1 | 10:57:57.472 [ForkJoinPool-1-worker-13] DEBUG com.zaxxer.hikari.HikariConfig - initializationFailTimeout.......1
job-board_1 | 10:57:57.473 [ForkJoinPool-1-worker-13] DEBUG com.zaxxer.hikari.HikariConfig - isolateInternalQueries..........false
job-board_1 | 10:57:57.473 [ForkJoinPool-1-worker-13] DEBUG com.zaxxer.hikari.HikariConfig - jdbcUrl.........................postgres://admin:password@postgres:5432/job-board
job-board_1 | 10:57:57.473 [ForkJoinPool-1-worker-13] DEBUG com.zaxxer.hikari.HikariConfig - leakDetectionThreshold..........0
job-board_1 | 10:57:57.474 [ForkJoinPool-1-worker-13] DEBUG com.zaxxer.hikari.HikariConfig - maxLifetime.....................1800000
job-board_1 | 10:57:57.474 [ForkJoinPool-1-worker-13] DEBUG com.zaxxer.hikari.HikariConfig - maximumPoolSize.................10
job-board_1 | 10:57:57.474 [ForkJoinPool-1-worker-13] DEBUG com.zaxxer.hikari.HikariConfig - metricRegistry..................none
job-board_1 | 10:57:57.475 [ForkJoinPool-1-worker-13] DEBUG com.zaxxer.hikari.HikariConfig - metricsTrackerFactory...........none
job-board_1 | 10:57:57.475 [ForkJoinPool-1-worker-13] DEBUG com.zaxxer.hikari.HikariConfig - minimumIdle.....................10
job-board_1 | 10:57:57.475 [ForkJoinPool-1-worker-13] DEBUG com.zaxxer.hikari.HikariConfig - password........................<masked>
job-board_1 | 10:57:57.476 [ForkJoinPool-1-worker-13] DEBUG com.zaxxer.hikari.HikariConfig - poolName........................"HikariPool-1"
job-board_1 | 10:57:57.476 [ForkJoinPool-1-worker-13] DEBUG com.zaxxer.hikari.HikariConfig - readOnly........................false
job-board_1 | 10:57:57.476 [ForkJoinPool-1-worker-13] DEBUG com.zaxxer.hikari.HikariConfig - registerMbeans..................false
job-board_1 | 10:57:57.476 [ForkJoinPool-1-worker-13] DEBUG com.zaxxer.hikari.HikariConfig - scheduledExecutor...............none
job-board_1 | 10:57:57.477 [ForkJoinPool-1-worker-13] DEBUG com.zaxxer.hikari.HikariConfig - schema..........................none
job-board_1 | 10:57:57.477 [ForkJoinPool-1-worker-13] DEBUG com.zaxxer.hikari.HikariConfig - threadFactory...................internal
job-board_1 | 10:57:57.478 [ForkJoinPool-1-worker-13] DEBUG com.zaxxer.hikari.HikariConfig - transactionIsolation............default
job-board_1 | 10:57:57.478 [ForkJoinPool-1-worker-13] DEBUG com.zaxxer.hikari.HikariConfig - username........................"admin"
job-board_1 | 10:57:57.478 [ForkJoinPool-1-worker-13] DEBUG com.zaxxer.hikari.HikariConfig - validationTimeout...............5000
job-board_1 | 10:57:57.482 [ForkJoinPool-1-worker-13] INFO com.zaxxer.hikari.HikariDataSource - HikariPool-1 - Starting...
job-board_1 | java.lang.RuntimeException: Failed to get driver instance for jdbcUrl=postgres://admin:password@postgres:5432/job-board
job-board_1 | at com.zaxxer.hikari.util.DriverDataSource.<init>(DriverDataSource.java:112)
job-board_1 | at com.zaxxer.hikari.pool.PoolBase.initializeDataSource(PoolBase.java:336)
job-board_1 | at com.zaxxer.hikari.pool.PoolBase.<init>(PoolBase.java:109)
job-board_1 | at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:108)
job-board_1 | at com.zaxxer.hikari.HikariDataSource.<init>(HikariDataSource.java:81)
job-board_1 | at io.github.jobboard.database.Database$.transactor(Database.scala:20)
job-board_1 | at io.github.jobboard.Main$$anonfun$1.apply(Main.scala:34)
job-board_1 | at io.github.jobboard.Main$$anonfun$1.apply(Main.scala:33)
job-board_1 | at fs2.Stream$$anonfun$flatMap$extension$1.apply(Stream.scala:1080)
job-board_1 | at fs2.Stream$$anonfun$flatMap$extension$1.apply(Stream.scala:1073)
job-board_1 | at fs2.internal.FreeC$$anonfun$flatMap$1.apply(FreeC.scala:33)
job-board_1 | at fs2.internal.FreeC$$anonfun$flatMap$1.apply(FreeC.scala:30)
job-board_1 | at fs2.internal.FreeC$ViewL$.mk(FreeC.scala:214)
job-board_1 | at fs2.internal.FreeC$ViewL$.apply(FreeC.scala:206)
job-board_1 | at fs2.internal.FreeC.viewL(FreeC.scala:67)
job-board_1 | at fs2.internal.Algebra$.fs2$internal$Algebra$$go$1(Algebra.scala:214)
job-board_1 | at fs2.internal.Algebra$$anonfun$fs2$internal$Algebra$$go$1$4$$anonfun$apply$5$$anonfun$apply$7.apply(Algebra.scala:260)
job-board_1 | at fs2.internal.Algebra$$anonfun$fs2$internal$Algebra$$interruptGuard$1$1.apply(Algebra.scala:230)
job-board_1 | at fs2.internal.Algebra$$anonfun$fs2$internal$Algebra$$interruptGuard$1$1.apply(Algebra.scala:229)
job-board_1 | at cats.effect.internals.IORunLoop$.cats$effect$internals$IORunLoop$$loop(IORunLoop.scala:139)
job-board_1 | at cats.effect.internals.IORunLoop$.startCancelable(IORunLoop.scala:41)
job-board_1 | at cats.effect.internals.IOBracket$BracketStart.run(IOBracket.scala:86)
job-board_1 | at cats.effect.internals.Trampoline.cats$effect$internals$Trampoline$$immediateLoop(Trampoline.scala:70)
job-board_1 | at cats.effect.internals.Trampoline.startLoop(Trampoline.scala:36)
job-board_1 | at cats.effect.internals.TrampolineEC$JVMTrampoline.cats$effect$internals$TrampolineEC$JVMTrampoline$$super$startLoop(TrampolineEC.scala:93)
job-board_1 | at cats.effect.internals.TrampolineEC$JVMTrampoline$$anonfun$startLoop$1.apply$mcV$sp(TrampolineEC.scala:93)
job-board_1 | at cats.effect.internals.TrampolineEC$JVMTrampoline$$anonfun$startLoop$1.apply(TrampolineEC.scala:93)
job-board_1 | at cats.effect.internals.TrampolineEC$JVMTrampoline$$anonfun$startLoop$1.apply(TrampolineEC.scala:93)
job-board_1 | at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:72)
job-board_1 | at cats.effect.internals.TrampolineEC$JVMTrampoline.startLoop(TrampolineEC.scala:92)
job-board_1 | at cats.effect.internals.Trampoline.execute(Trampoline.scala:43)
job-board_1 | at cats.effect.internals.TrampolineEC.execute(TrampolineEC.scala:44)
job-board_1 | at cats.effect.internals.IOBracket$BracketStart.apply(IOBracket.scala:72)
job-board_1 | at cats.effect.internals.IOBracket$BracketStart.apply(IOBracket.scala:52)
job-board_1 | at cats.effect.internals.IORunLoop$.cats$effect$internals$IORunLoop$$loop(IORunLoop.scala:136)
job-board_1 | at cats.effect.internals.IORunLoop$.start(IORunLoop.scala:34)
job-board_1 | at cats.effect.internals.IOBracket$$anonfun$apply$1.apply(IOBracket.scala:44)
job-board_1 | at cats.effect.internals.IOBracket$$anonfun$apply$1.apply(IOBracket.scala:34)
job-board_1 | at cats.effect.internals.IORunLoop$RestartCallback.start(IORunLoop.scala:341)
job-board_1 | at cats.effect.internals.IORunLoop$.cats$effect$internals$IORunLoop$$loop(IORunLoop.scala:119)
job-board_1 | at cats.effect.internals.IORunLoop$RestartCallback.signal(IORunLoop.scala:355)
job-board_1 | at cats.effect.internals.IORunLoop$RestartCallback.apply(IORunLoop.scala:376)
job-board_1 | at cats.effect.internals.IORunLoop$RestartCallback.apply(IORunLoop.scala:316)
job-board_1 | at cats.effect.internals.IOShift$Tick.run(IOShift.scala:36)
job-board_1 | at scala.concurrent.impl.ExecutionContextImpl$AdaptedForkJoinTask.exec(ExecutionContextImpl.scala:121)
job-board_1 | at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
job-board_1 | at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
job-board_1 | at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
job-board_1 | at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
job-board_1 | Caused by: java.sql.SQLException: No suitable driver
job-board_1 | at java.sql.DriverManager.getDriver(DriverManager.java:315)
job-board_1 | at com.zaxxer.hikari.util.DriverDataSource.<init>(DriverDataSource.java:104)
job-board_1 | ... 48 more
job-board_1 |
job-board_1 | Exception: sbt.TrapExitSecurityException thrown from the UncaughtExceptionHandler in thread "run-main-0"
job-board_1 | [error] Nonzero exit code: 1
job-board_1 | [error] (Compile / run) Nonzero exit code: 1
job-board_1 | [error] Total time: 4 s, completed Aug 13, 2020 10:57:57 AM
job-board_job-board_1 exited with code 1