Skip to content

Commit

Permalink
ci: dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
EndangeredF1sh committed Sep 28, 2024
1 parent 4a4bdc9 commit 83747a2
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
__pycache__
*.pyc
*.pyo
*.swp
.env
27 changes: 27 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

# Original repo uses python 3.9
FROM python:3.9-slim

# NO PYC FILES
ENV PYTHONDONTWRITEBYTECODE=1

# NO BUFFER, OUTPUT TO TERMINAL
ENV PYTHONUNBUFFERED=1

WORKDIR /app

RUN apt-get update && apt-get install -y --no-install-recommends build-essential

COPY requirements.txt .

RUN pip install --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt

COPY . .

# Gradio port
EXPOSE 7860

ENV OPENAI_API_KEY=""

CMD ["python", "app.py"]
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,20 @@ To run the PDF2Audio app:

4. Use the Gradio interface to upload a PDF file and convert it to audio.

## Docker

1. **Build**
```bash
docker build -t pdf2audio .
```

2. **Run**
```bash
docker run -p 7860:7860 pdf2audio
```

3. **Access the Gradio interface:** `http://localhost:7860`.

## How to Use

1. Upload one or more PDF files
Expand Down Expand Up @@ -117,5 +131,4 @@ This project was inspired by and based on the code available at [https://github.
year={2024},
url={http://iopscience.iop.org/article/10.1088/2632-2153/ad7228},
}
```

```
2 changes: 1 addition & 1 deletion app.py
Original file line number Diff line number Diff line change
Expand Up @@ -880,4 +880,4 @@ def update_edit_box(checkbox_value):

# Launch the Gradio app
if __name__ == "__main__":
demo.launch()
demo.launch(server_name="0.0.0.0")

0 comments on commit 83747a2

Please sign in to comment.