最近執行一個專案,會在docker容器中安裝grdio,一個可以快速建構的web gui
ports:
"7860:7860"
但實際存取後發現無法訪問,如下
所以我一開始只能用public url進去使用
environment:
- GRADIO_SERVER_NAME=0.0.0.0
- GRADIO_SERVER_PORT=7860
最終修改完的docker-compose.yaml
(for MobileSAM)
services:
mobilesam:
stdin_open: true
tty: true
devices:
- /dev/dri
volumes:
- .:/root/MobileSAM
ports:
- "7860:7860"
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities:
- gpu
environment:
- QT_X11_NO_MITSHM=1
- NVIDIA_VISIBLE_DEVICES=all
- NVIDIA_DRIVER_CAPABILITIES=all
- GRADIO_SERVER_NAME=0.0.0.0
- GRADIO_SERVER_PORT=7860
container_name: mobilesam-container
build: .
image: frakw/mobilesam:latest
command: /bin/bash