1
0
Fork 0

Create docker-compose.yml

This commit is contained in:
Jason 2025-06-19 15:34:09 +08:00 committed by GitHub
parent 694560a627
commit e76dd64081
1 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,29 @@
version: "3"
services:
komari:
# 使用官方推荐的镜像
image: ghcr.io/komari-monitor/komari:latest
# 容器名称,这是 1Panel 的标准变量,请勿修改
container_name: ${CONTAINER_NAME}
# 总是重新启动,确保服务可用性
restart: always
# 将用户定义的端口映射到容器的 25774 端口
ports:
- ${PANEL_APP_PORT_HTTP}:25774
# 挂载数据目录,确保数据持久化
volumes:
- ./data:/app/data
# 设置环境变量,允许用户自定义初始的用户名和密码
environment:
- ADMIN_USERNAME=${ADMIN_USERNAME}
- ADMIN_PASSWORD=${ADMIN_PASSWORD}
# 将容器连接到 1Panel 的网络
networks:
- 1panel-network
# 1Panel 要求的标签
labels:
createdBy: "Apps"
networks:
1panel-network:
external: true