34 lines
830 B
YAML
34 lines
830 B
YAML
services:
|
|
sam3:
|
|
build: .
|
|
container_name: sam3_fixed
|
|
# 启用 GPU
|
|
deploy:
|
|
resources:
|
|
reservations:
|
|
devices:
|
|
- driver: nvidia
|
|
count: 1
|
|
capabilities: [gpu]
|
|
|
|
# 共享内存优化
|
|
shm_size: '16gb'
|
|
|
|
volumes:
|
|
# 👇 这里是最关键的修正 👇
|
|
- ./checkpoints:/app/checkpoints # 确保容器能读到你刚刚救出来的 .pt 文件
|
|
- ./data:/app/data # 数据映射
|
|
- ./outputs:/app/outputs # 输出结果
|
|
|
|
environment:
|
|
- NVIDIA_VISIBLE_DEVICES=all
|
|
- NVIDIA_DRIVER_CAPABILITIES=compute,utility,video
|
|
|
|
ports:
|
|
- "7860:7860" # Gradio 端口
|
|
- "8888:8888" # Jupyter 端口 (保留着也没事)
|
|
|
|
stdin_open: true
|
|
tty: true
|
|
restart: unless-stopped
|