Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +23 -6
Dockerfile
CHANGED
|
@@ -1,12 +1,29 @@
|
|
| 1 |
-
# Use
|
| 2 |
-
FROM
|
| 3 |
|
| 4 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
COPY requirements.txt .
|
| 6 |
-
RUN pip install -r requirements.txt
|
| 7 |
|
| 8 |
-
# Copy
|
| 9 |
COPY app.py .
|
| 10 |
|
| 11 |
-
#
|
|
|
|
|
|
|
|
|
|
| 12 |
CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]
|
|
|
|
|
|
| 1 |
+
# Use an official Python runtime as a parent image
|
| 2 |
+
FROM python:3.9-slim
|
| 3 |
|
| 4 |
+
# Set environment variables
|
| 5 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
| 6 |
+
|
| 7 |
+
# Install Tesseract OCR and its dependencies
|
| 8 |
+
RUN apt-get update && apt-get install -y \
|
| 9 |
+
tesseract-ocr \
|
| 10 |
+
libtesseract-dev \
|
| 11 |
+
libleptonica-dev \
|
| 12 |
+
pkg-config \
|
| 13 |
+
poppler-utils \
|
| 14 |
+
&& apt-get clean \
|
| 15 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 16 |
+
|
| 17 |
+
# Install Python dependencies
|
| 18 |
COPY requirements.txt .
|
| 19 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 20 |
|
| 21 |
+
# Copy the application code
|
| 22 |
COPY app.py .
|
| 23 |
|
| 24 |
+
# Expose the port Streamlit will run on
|
| 25 |
+
EXPOSE 7860
|
| 26 |
+
|
| 27 |
+
# Command to run the application
|
| 28 |
CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]
|
| 29 |
+
|