[#1] 构建镜像;USER root; 使用supervisor守护进程;端到端本地测试

This commit is contained in:
root
2025-09-15 09:59:49 +00:00
parent 653a0c04a6
commit 31a6ab9803
25 changed files with 559 additions and 209 deletions

View File

@@ -0,0 +1,26 @@
#!/bin/bash
set -euo pipefail
echo "[INFO] Starting Elasticsearch under supervisor..."
# 创建数据目录(如果不存在)
mkdir -p /private/argus/log/elasticsearch
# 创建软链接到Elasticsearch预期的数据目录
if [ -L /usr/share/elasticsearch/data ]; then
rm /usr/share/elasticsearch/data
elif [ -d /usr/share/elasticsearch/data ]; then
rm -rf /usr/share/elasticsearch/data
fi
ln -sf /private/argus/log/elasticsearch /usr/share/elasticsearch/data
echo "[INFO] Data directory linked: /usr/share/elasticsearch/data -> /private/argus/log/elasticsearch"
# 设置环境变量(ES配置通过docker-compose传递)
export ES_JAVA_OPTS="${ES_JAVA_OPTS:-"-Xms512m -Xmx512m"}"
echo "[INFO] Starting Elasticsearch process..."
# 启动原始的Elasticsearch entrypoint
exec /usr/local/bin/docker-entrypoint.sh elasticsearch