目前我只是在等待一个比较安全的时间框架,然后在这个 docker-compose 文件中启动应用程序容器:
# this compose spins up a db2 database for development purposes
version: "3"
services:
db2: # https://hub.docker.com/r/ibmcom/db2
# image: ibmcom/db2:11.5.8.0
image: icr.io/db2_community/db2:11.5.8.0
privileged: true
expose:
- 50000
ports:
- "50000:50000"
environment:
LICENSE: accept
DBNAME: sample
DB2INSTANCE: db2inst1
DB2INST1_PASSWORD: change-me-please
healthcheck:
# TODO find a real health check for db2
test: [ "CMD", "sleep", "300"]
interval: 30s
timeout: 301s
retries: 3
app:
build:
context: ../../
dockerfile: ./src/infrastructure/Dockerfile
expose:
- 7070
ports:
- "7071:7070"
environment:
APP_PROFILE: compose
depends_on:
db2:
condition: service_healthy
restart: on-failure
是否有任何特定于 db2 的工具能够为我提供更好的健康检查? 欢迎任何指导。 对于上下文,整个项目是here.