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

相关推荐
kidding7233 小时前
前端VUE3的面试题
前端·typescript·compositionapi·fragment·teleport·suspense
来一碗刘肉面20 小时前
TypeScript - 属性修饰符
前端·javascript·typescript
Rowrey1 天前
react+typescript,初始化与项目配置
javascript·react.js·typescript
乔冠宇2 天前
微信小程序中将图片截图为正方形(自动居中)
微信小程序·小程序·typescript·uniapp
念九_ysl2 天前
前端循环全解析:JS/ES/TS 循环写法与实战示例
前端·javascript·typescript
MardaWang3 天前
HarmonyOS开发,遇到 Object.assign(this, source)报错怎么解决?
typescript·harmonyos
IT、木易3 天前
TypeScript跟js,es6这些的区别
javascript·typescript·es6
孟陬4 天前
持续改善 React 代码的 SOLID 原则(附带 hooks 详细案例)适用于高级前端
react.js·设计模式·typescript
李二。4 天前
TypeScript学习:初学
typescript
DCTANT4 天前
【原创】vue-element-admin-plus完成编辑页面中嵌套列表功能
前端·javascript·vue.js·elementui·typescript