Apache Casbin Gateway
5. 运维

5.4 Docker与Podman

容器里看不到你机器上的Agent。

Agent是靠读Gateway所在这台机器的主目录和安装路径发现的,而在容器里那就是容器自己的文件系统。所以Agent客户端、技能、MCP与提示词和Agent监控在那里都是空的——页面会直说,而不是假装什么都没装。

不依赖宿主机的部分照常工作:供应商、真伪检测和LLM记录。

所以:想观察哪台机器上的Agent,就在那台机器上跑一键安装;容器留给"Gateway只作为别的机器的模型端点"这种场景。

怎么跑

没有发布镜像,compose文件会从本仓库的一份检出里构建:

docker compose up -d

Podman读同一个文件:

podman compose up -d

两种方式下:

  • 界面在http://localhost:17000。
  • SQLite数据库放在一个**down之后依然存在的命名卷**里。
  • conf/app.conf从仓库挂载进去,所以第一次启动前就能改它播种的那些设置,不用重新构建镜像。

如果它要服务别的机器

容器通常从宿主机外面就能连上,这正是5.2那一节讲的情况:改掉管理员密码,并且每个发往/v1的请求都带上中继令牌。

下一节:5.5 升级、停止与卸载。

在GitHub上编辑
Apache Incubator

Apache Casbin (Incubating) is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.

Copyright © 2026 The Apache Software Foundation, Licensed under the Apache License, Version 2.0.

Apache, Apache Casbin, the names of Apache projects, and the feather logo are either registered trademarks or trademarks of The Apache Software Foundation in the United States and/or other countries. All other marks mentioned may be trademarks or registered trademarks of their respective owners.

本页内容