chore: 统一本地服务器与远程仓库源码
- 合并 main 与 master 历史并以服务器结构为基线 - 保留迁移、数据保留、AWS 账单与部署安全能力 - 建立 SDD 规格和 CI 验证闭环
This commit is contained in:
commit
fd60361d93
460 files changed
+37492
-23871
No files matched your search
+12
-9
@@ -112,13 +112,6 @@ RUN chmod +x /tmp/setup-alpine-mirrors.sh && /tmp/setup-alpine-mirrors.sh && \
|
||||
/tmp/install-kubectl.sh /usr/local/bin/kubectl && \
|
||||
rm -f /tmp/setup-alpine-mirrors.sh /tmp/install-kubectl.sh
|
||||
|
||||
# Maven 阿里云镜像加速(maven 懒加载后生效)
|
||||
RUN mkdir -p /root/.m2 && \
|
||||
echo '<?xml version="1.0" encoding="UTF-8"?><settings><mirrors><mirror><id>aliyun</id><mirrorOf>central</mirrorOf><name>Aliyun Maven</name><url>https://maven.aliyun.com/repository/public</url></mirror></mirrors></settings>' > /root/.m2/settings.xml
|
||||
|
||||
# npm 淘宝镜像加速(node 懒加载后生效)
|
||||
RUN npm config set registry https://registry.npmmirror.com 2>/dev/null || true
|
||||
|
||||
ENV TZ=Asia/Shanghai
|
||||
|
||||
WORKDIR /app
|
||||
@@ -126,8 +119,13 @@ WORKDIR /app
|
||||
# 复制后端二进制(前端已嵌入)
|
||||
COPY --from=backend-builder /app/aiops .
|
||||
|
||||
# 创建运行时目录
|
||||
RUN mkdir -p /app/agent/bin /app/agent/deploy
|
||||
# 创建非 root 运行用户及应用可写目录。工具懒加载目录由该用户写入。 // Logan.Li
|
||||
RUN addgroup -S -g 10001 aiops && \
|
||||
adduser -S -D -H -u 10001 -G aiops aiops && \
|
||||
mkdir -p /app/agent/bin /app/agent/deploy /app/uploads /app/logs /app/tmp \
|
||||
/home/aiops && \
|
||||
chown -R aiops:aiops /app /home/aiops /usr/local && \
|
||||
chmod 1777 /tmp
|
||||
|
||||
# 复制 agent 二进制。 // Logan.Li
|
||||
COPY --from=agent-builder /agent/bin/aiops-agent-linux-${TARGETARCH} /app/agent/bin/aiops-agent-linux-${TARGETARCH}
|
||||
@@ -138,6 +136,11 @@ COPY agent/deploy/install.sh /app/agent/deploy/
|
||||
COPY agent/deploy/install.ps1 /app/agent/deploy/
|
||||
COPY agent/deploy/aiops-agent.service /app/agent/deploy/
|
||||
|
||||
# 应用进程不得使用 root;部署清单还会限制 Linux capabilities。 // Logan.Li
|
||||
USER 10001:10001
|
||||
ENV HOME=/home/aiops \
|
||||
TMPDIR=/app/tmp
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 \
|
||||
|
||||
Reference in new issue
Block a user