-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
38 lines (36 loc) · 1.25 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
version: '3.9'
services:
f-ai:
container_name: f-ai
image: 2720851545/f-ai:20221003
restart: unless-stopped
# network_mode: "host"
# 容器端口暴露, 右侧为容器端口, 左侧为宿主机端口
ports:
- "8000:8000"
volumes:
# AI模型缓存
- "./cache:/root/"
# 图片识别结果保存位置
- "./image_visualization:/f-ai/image_visualization"
environment:
- IS_VISUALIZATION=true
- IMAGE_RESULT_PATH=/f-ai/image_visualization
- IS_LAZY_LOAD_MODULES=true
# cpu资源限制, docker-compose要使用最新版本才支持
deploy:
resources:
limits:
cpus: '0.8'
reservations:
cpus: '0.25'
# traefik配置, 没有使用不用理会
labels:
- "traefik.http.routers.f-ai.rule=Host(`f-ai.llyke.lol`)"
- "traefik.http.services.f-ai.loadbalancer.server.port=8000"
- "traefik.http.routers.f-ai.tls=true"
- "traefik.http.routers.f-ai.entrypoints=websecure"
- "traefik.http.routers.f-ai.tls.certResolver=letsencryptResolver"
- "traefik.http.routers.f-ai-https.rule=Host(`f-ai.llyke.lol`)"
- "traefik.http.routers.f-ai-https.entrypoints=web"
- "traefik.http.routers.f-ai-https.middlewares=http2https"