diff --git a/write-server/docker-compose.yml b/write-server/docker-compose.yml index cb1c2775..063fd85f 100644 --- a/write-server/docker-compose.yml +++ b/write-server/docker-compose.yml @@ -13,8 +13,8 @@ services: ports: - "8016:8016" volumes: - # Hugo 博客目录(必须) - - ${BLOG_ROOT:-../blog}:/blog + # Hugo 博客目录(必须)- .. 即为 write-server 的上级目录(博客根目录) + - ${BLOG_ROOT:-..}:/blog # 本地回收站目录 - ./recycle:/app/recycle # 日志目录 @@ -31,11 +31,11 @@ services: networks: - write-network healthcheck: - test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8016/api/stats"] + test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://127.0.0.1:8016/api/stats"] interval: 30s timeout: 10s retries: 3 - start_period: 40s + start_period: 60s logging: driver: "json-file" options: @@ -57,7 +57,7 @@ services: - ./logs/nginx:/var/log/nginx depends_on: write-server: - condition: service_healthy + condition: service_started networks: - write-network diff --git a/write-server/scripts/healthcheck.sh b/write-server/scripts/healthcheck.sh index 9d148494..5e6a91d9 100644 --- a/write-server/scripts/healthcheck.sh +++ b/write-server/scripts/healthcheck.sh @@ -6,7 +6,7 @@ set -e # 配置 PORT=${PORT:-8016} -HOST=${HOST:-localhost} +HOST=${HOST:-127.0.0.1} TIMEOUT=${HEALTH_CHECK_TIMEOUT:-5} # 检查服务是否响应