Update Dockerfile and README.md for Docker support

This commit is contained in:
Mert Cobanov 2024-04-26 05:05:06 +03:00
parent 5178952ab6
commit aea37cf409
3 changed files with 51 additions and 0 deletions

25
Dockerfile Normal file
View File

@ -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"]

View File

@ -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.

12
docker-compose.yml Normal file
View File

@ -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"