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

相关推荐
浪遏20 小时前
从命令到工作流:juejin-cli 如何让写作自动化更可靠
typescript
浪遏1 天前
07|网页上看着正常,导出的 PDF 为什么还会变样
typescript
浪遏1 天前
03|自动保存真正难的部分,是保存期间又发生了修改
typescript
浪遏1 天前
04|同一篇资料,怎样同时交给编辑器、搜索和 AI
typescript
浪遏1 天前
09|让 Mermaid 和 HTML 成为可编辑内容块
typescript
️公子1 天前
可插拔 13 款实时棋牌对战平台实践:房间容器、Plugin SDK 与幂等账本
websocket·typescript·游戏开发·monorepo·插件架构·棋牌平台·实时对战
FungLeo1 天前
成为全栈·Vue 管理后台篇·Vue3 + Vite + Naive UI:后台工程基座怎么搭
前端·vue.js·ui·typescript·vite·前端工程化·biome
FungLeo2 天前
成为全栈·Vue管理后台篇·<scriptsetup>:把页面拆成可读、可测的 Vue 组件
前端·javascript·vue.js·typescript·前端组件化·composition api·vue sfc
theMuseCatcher4 天前
Vue3导航菜单(Menu)
typescript·vue3·less
theMuseCatcher5 天前
Vue3评论(Comment)
typescript·vue3