gradio-osprey-demo

创建需要的dockerfle

###################

使用 Ubuntu 作为基础镜像

FROM nvcr.io/nvidia/cuda:11.8.0-devel-ubuntu22.04

更新软件包列表并安装依赖项

RUN apt update && \

apt install -y python3 python3-pip git ffmpeg libsm6 libxext6 curl wget vim libgl1 && \

cp /usr/bin/python3 /usr/bin/python && \

pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118 && \

pip install git+https://github.com/facebookresearch/segment-anything.git && \

pip install opencv-python pycocotools matplotlib onnxruntime onnx

设置 Node.js 环境变量

ENV NODE_OPTIONS="--max-old-space-size=8192"

安装 nvm、Node.js 和 pnpm

ENV NVM_DIR /root/.nvm

RUN mkdir -p $NVM_DIR && curl https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash && . ~/.bashrc && nvm install v18.16.0

RUN . NVM_DIR/nvm.sh \&\& ln -s NVM_DIR/(nvm current) NVM_DIR/cur && ln -s NVM_DIR/versions/node/(nvm current) $NVM_DIR/versions/node/cur

ENV NODE_PATH $NVM_DIR/cur/lib/node_modules

ENV PATH NVM_DIR/versions/node/cur/bin:PATH

ADD pnpm /usr/local/bin/

RUN chmod a+x /usr/local/bin/pnpm

设置环境变量

ENV NODE_OPTIONS=--max_old_space_size=6000

克隆并安装 Gradio 应用

RUN git clone https://github.com/LiWentomng/gradio-osprey-demo.git && \

cd gradio-osprey-demo && \

bash scripts/build_frontend.sh && \

pip install -e .

设置工作目录

WORKDIR /gradio-osprey-demo

可选:暴露端口

EXPOSE <port>

可选:指定容器启动时的命令

CMD sleep 10000000000

相关推荐
Patrick_Wilson1 天前
悬浮提示从哪来:LSP、tsserver 与 .d.ts
typescript·npm·前端工程化
oldnicke2 天前
理解 TRAE 的 Agent + IDE 思路:用一个 Markdown 检查器拆解完整交付
typescript
钱栈up2 天前
GitHub 热榜实测|REA:用 Agent 逆向一切
typescript·开源·github
keyipatience2 天前
TypeScript学习(1)
前端·javascript·学习·typescript·html·css3
RuoyiOffice2 天前
Vue3+TypeScript 企业管理平台统一UI:新增一个模块,为什么还要重新调样式?
spring boot·typescript·vue3·组件化开发·企业管理软件·ruoyi office·统一ui
Shockang3 天前
TanStack Router 实战:URL 校验、Loader 与路由权限
typescript·react·路由·前端开发·tanstack router
TYC93 天前
Mac创建Vue3+TypeScript或者React+TypeScript项目
前端·javascript·typescript
fbincon4 天前
Claude Code 自定义状态栏工具:安装、配置与 Subagent 状态展示
python·typescript·claude·claude-code·statusline
何何____4 天前
TypeScript 函数类型兼容性
前端·javascript·typescript
VimorphTech4 天前
React 任务轮询,为什么不能只写一个 setInterval?
javascript·typescript