36 lines
1.4 KiB
YAML
36 lines
1.4 KiB
YAML
# 使用本地 AI-CloudOps-aiops 目录构建 cloudops-aiops(不再在镜像内 git clone)。
|
||
#
|
||
# build context 固定为本仓库根目录,便于 dockerfile 使用 deploy/docker/...;
|
||
# aiops 源码目录由 additional_contexts「aiops-src」指定(需 Docker Compose v2.17+ / BuildKit)。
|
||
#
|
||
# 默认 AIOPS_ROOT=./AI-CloudOps-aiops(克隆在本仓库内);若在同级目录:
|
||
# AIOPS_ROOT=../AI-CloudOps-aiops
|
||
# Windows 绝对路径示例:
|
||
# AIOPS_ROOT=C:/work/智能运维管理平台/AI-CloudOps-aiops
|
||
#
|
||
# docker compose -f docker-compose.yaml -f docker-compose.aiops-local.yaml up -d --build
|
||
#
|
||
services:
|
||
cloudops-aiops:
|
||
build:
|
||
context: .
|
||
dockerfile: deploy/docker/Dockerfile.aiops.local
|
||
additional_contexts:
|
||
aiops-src: ${AIOPS_ROOT:-./AI-CloudOps-aiops}
|
||
image: gcc-ai-devops-aiops:local
|
||
entrypoint: ["/bin/sh", "/opt/aiops-entrypoint.sh"]
|
||
# 覆盖 entrypoint 后 Compose 可能不继承镜像 CMD,导致 entrypoint 里 exec "$@" 无参数即退出(Restarting 0);须显式写出与 Dockerfile.aiops.local 一致。
|
||
command:
|
||
- uvicorn
|
||
- app.main:app
|
||
- --host
|
||
- 0.0.0.0
|
||
- --port
|
||
- "8080"
|
||
- --proxy-headers
|
||
- --forwarded-allow-ips
|
||
- "*"
|
||
volumes:
|
||
- ./deploy/docker/aiops-entrypoint.sh:/opt/aiops-entrypoint.sh:ro
|
||
- ./deploy/docker/aiops-env-from-redis.py:/opt/aiops-env-from-redis.py:ro
|