From aea37cf4095e2475b6568c7258518ce66e9a7cd1 Mon Sep 17 00:00:00 2001 From: Mert Cobanov Date: Fri, 26 Apr 2024 05:05:06 +0300 Subject: [PATCH] Update Dockerfile and README.md for Docker support --- Dockerfile | 25 +++++++++++++++++++++++++ README.md | 14 ++++++++++++++ docker-compose.yml | 12 ++++++++++++ 3 files changed, 51 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a618844 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,25 @@ +# Use an official Python runtime as the base image +FROM python:3.9-slim + +# Set the working directory in the container +WORKDIR /app + +# Copy the requirements file into the container +COPY requirements.txt . + +# Install the required dependencies +RUN pip install --no-cache-dir -r requirements.txt + +# Copy the rest of the application code into the container +COPY . . + +# Expose the port that the application will listen on +EXPOSE 7860 + +# Set the environment variable +ENV GRADIO_SERVER_NAME="0.0.0.0" + +# Define the command to run the application +CMD ["python", "webui.py"] + + diff --git a/README.md b/README.md index 7f17e67..65d1dd6 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,20 @@ python webui.py ![gradio](assets/gradio.png) +## Docker + +```bash +docker build -t web_summarizer . +docker run -p 7860:7860 web_summarizer + +# Run if you run ollama on host +docker run --network='host' -p 7860:7860 web_summarizer + +# Run both app and ollama as docker containers +docker compose up +``` + + ## Development To contribute to the development of this script, clone the repository, make your changes, and submit a pull request. We welcome contributions that improve the script's functionality or extend its capabilities. diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..76a35c6 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,12 @@ +version: "3" +services: + ollama-container: + image: ollama/ollama + volumes: + - ./data/ollama:/root/.ollama + ports: + - "11434:11434" + gradio-app: + image: easy-web-summarizer + ports: + - "7860:7860"