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"