You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Spring Boot 3+H2项目无法在Docker容器中运行求助

Spring Boot 3集成H2数据库Docker部署失败问题排查

我有一个集成H2数据库的Spring Boot 3项目,尝试部署到Docker容器时运行失败,使用的Docker命令如下:

docker build -t spring-hope .
docker run -p 8080:8080 spring-hope

项目的application.yml配置内容如下:

spring:
  application:
    name: hope
  datasource:
    driver-class-name: org.h2.Driver
    username: sa
    password:
  jpa:
    database-platform: org.hibernate.dialect.H2Dialect
    hibernate:
      ddl-auto: update
  properties:
    jakarta.persistence.jdbc.url: jdbc:h2:mem:testdb
    hibernate.dialect: org.hibernate.dialect.H2Dialect
  h2:
    console:
      enabled: true
      path: /h2-console
server:
  error:
    include-message: always
    include-binding-errors: always

运行容器时抛出异常,异常详情可查看项目仓库中的error.txt文件,项目代码托管在GitHub仓库。

请问问题出在哪里?


内容的提问来源于stack exchange,提问作者Octavio Cárdenas

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.14 11:27:34