Press "Enter" to skip to content

docker compose network host and healthcheck

配置docker-compose容器使用host网络(主机网络)模式和健康检查

version: '3.6'
services:
  mangosd:
    stdin_open: true
    tty: true
    image: vmangos/mangosd:amd
    restart: always
    healthcheck:
      test: ["CMD-SHELL", "curl -sS 127.0.0.1:8085 || exit 1"]
      interval: 1m30s
      timeout: 10s
      retries: 3
      start_period: 40s    
    ports:
      - target: 8085
        published: 8085
        protocol: tcp
        mode: host
      - target: 7878
        published: 7878
        protocol: tcp
        mode: host
发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注