1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2024-11-24 08:52:31 +02:00

add gradio

This commit is contained in:
kev 2024-04-12 11:51:53 +08:00
parent 25a5e67907
commit c86b7a5400
5 changed files with 50 additions and 0 deletions

View File

@ -202,6 +202,7 @@ A collection of delicious docker recipes.
- [x] django-cms
- [x] dokuwiki :+1:
- [x] gogs-arm :cn:
- [x] gradio
- [x] hugo
- [x] hugo-arm
- [x] jamapi

13
gradio/Dockerfile Normal file
View File

@ -0,0 +1,13 @@
#
# Dockerfile for gradio
#
FROM python:3.12-slim
ENV GRADIO_SERVER_NAME="0.0.0.0"
RUN pip install --no-cache-dir gradio
EXPOSE 7860
ENTRYPOINT ["python"]

17
gradio/README.md Normal file
View File

@ -0,0 +1,17 @@
gradio
======
[Gradio][1] is the fastest way to demo your machine learning model with a
friendly web interface so that anyone can use it, anywhere!
## up and running
```bash
$ docker compose up -d
$ open http://127.0.0.1:7860
```
More demos can be found [here][2].
[1]: https://www.gradio.app/
[2]: https://www.gradio.app/playground

9
gradio/data/app.py Normal file
View File

@ -0,0 +1,9 @@
#!/usr/bin/env python
import gradio as gr
def greet(name):
return "Hello " + name + "!"
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
demo.launch()

10
gradio/docker-compose.yml Normal file
View File

@ -0,0 +1,10 @@
version: "3.8"
services:
gradio:
image: vimagick/gradio
command: app.py
ports:
- "7860:7860"
volumes:
- ./data:/data
working_dir: /data