diff --git a/README.md b/README.md index f51ccc1..693e09e 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/gradio/Dockerfile b/gradio/Dockerfile new file mode 100644 index 0000000..d2796dd --- /dev/null +++ b/gradio/Dockerfile @@ -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"] diff --git a/gradio/README.md b/gradio/README.md new file mode 100644 index 0000000..ac4a06f --- /dev/null +++ b/gradio/README.md @@ -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 diff --git a/gradio/data/app.py b/gradio/data/app.py new file mode 100644 index 0000000..2304d71 --- /dev/null +++ b/gradio/data/app.py @@ -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() diff --git a/gradio/docker-compose.yml b/gradio/docker-compose.yml new file mode 100644 index 0000000..c90bf0c --- /dev/null +++ b/gradio/docker-compose.yml @@ -0,0 +1,10 @@ +version: "3.8" +services: + gradio: + image: vimagick/gradio + command: app.py + ports: + - "7860:7860" + volumes: + - ./data:/data + working_dir: /data