13693261870
9 天以前 61ea1f587c8003c2cd89d0f799149c6f328d26b4
添加健康检测功能
已修改1个文件
34 ■■■■ 文件已修改
docker/docker-compose.yml 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docker/docker-compose.yml
@@ -16,7 +16,7 @@
      POSTGRES_DB: jhs
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U postgres"]
      interval: 5s
      interval: 10s
      timeout: 2s
      retries: 3
    privileged: true
@@ -41,6 +41,12 @@
      - ./nacos/logs/:/home/nacos/logs
      - ./nacos/plugins:/home/nacos/plugins
      #- ./nacos/conf/application.properties:/home/nacos/conf/application.properties
    healthcheck:
      test: ["CMD-SHELL", "curl -f http://localhost:8080 || exit 1"]
      interval: 10s
      timeout: 2s
      retries: 3
      start_period: 10s
    ports:
      - 8080:8080
      - 8848:8848
@@ -60,6 +66,11 @@
    volumes:
      - ./redis/redis.conf:/data/redis.conf
      - ./redis/data:/data
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 10s
      timeout: 2s
      retries: 3
    #command: redis-server --requirepass Redis_s!E_6.2.6
    command: redis-server /data/redis.conf
    networks:
@@ -72,10 +83,13 @@
      - ./gateway:/app
    environment:
      TZ: Asia/Shanghai
    entrypoint: /bin/sh -c "sleep 30 && java -jar /app/se-gateway.jar --spring.config.location=file:/app/"
    #entrypoint: /bin/sh -c "sleep 30 && java -jar /app/se-gateway.jar --spring.config.location=file:/app/"
    entrypoint: java -jar /app/se-gateway.jar --spring.config.location=file:/app/
    depends_on:
      - redis
      - nacos
      redis:
        condition: service_healthy
      nacos:
        condition: service_healthy
    networks:
      - network-jhs
  # system
@@ -86,11 +100,15 @@
      - ./system:/app
    environment:
      TZ: Asia/Shanghai
    entrypoint: /bin/sh -c "sleep 30 && java -jar /app/se-system.jar --spring.config.location=file:/app/"
    #entrypoint: /bin/sh -c "sleep 30 && java -jar /app/se-system.jar --spring.config.location=file:/app/"
    entrypoint: java -jar /app/se-system.jar --spring.config.location=file:/app/
    depends_on:
      - postgis
      - nacos
      - redis
      postgis:
        condition: service_healthy
      redis:
        condition: service_healthy
      nacos:
        condition: service_healthy
    networks:
      - network-jhs
  # nginx