Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +9 -16
Dockerfile
CHANGED
|
@@ -1,6 +1,5 @@
|
|
| 1 |
-
FROM python:3.9
|
| 2 |
|
| 3 |
-
# Install system dependencies including poppler-utils and tesseract
|
| 4 |
RUN apt-get update && apt-get install -y \
|
| 5 |
tesseract-ocr \
|
| 6 |
&& rm -rf /var/lib/apt/lists/*
|
|
@@ -8,21 +7,15 @@ RUN apt-get update && apt-get install -y \
|
|
| 8 |
# Set environment variable for Tesseract
|
| 9 |
ENV TESSDATA_PREFIX=/usr/share/tesseract-ocr/4.00/tessdata
|
| 10 |
|
| 11 |
-
# Create app directory
|
| 12 |
-
WORKDIR /app
|
| 13 |
-
|
| 14 |
-
# Install Python dependencies
|
| 15 |
-
COPY requirements.txt .
|
| 16 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
| 17 |
|
| 18 |
-
|
| 19 |
-
|
|
|
|
| 20 |
|
| 21 |
-
|
| 22 |
-
RUN mkdir -p uploads && chmod 777 uploads
|
| 23 |
|
| 24 |
-
|
| 25 |
-
|
| 26 |
|
| 27 |
-
|
| 28 |
-
CMD ["gunicorn", "
|
|
|
|
| 1 |
+
FROM python:3.9
|
| 2 |
|
|
|
|
| 3 |
RUN apt-get update && apt-get install -y \
|
| 4 |
tesseract-ocr \
|
| 5 |
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
| 7 |
# Set environment variable for Tesseract
|
| 8 |
ENV TESSDATA_PREFIX=/usr/share/tesseract-ocr/4.00/tessdata
|
| 9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
+
RUN useradd -m -u 1000 user
|
| 12 |
+
USER user
|
| 13 |
+
ENV PATH="/home/user/.local/bin:$PATH"
|
| 14 |
|
| 15 |
+
WORKDIR /app
|
|
|
|
| 16 |
|
| 17 |
+
COPY --chown=user ./requirements.txt requirements.txt
|
| 18 |
+
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 19 |
|
| 20 |
+
COPY --chown=user . /app
|
| 21 |
+
CMD ["gunicorn", "-b", "0.0.0.0:7860", "app:app"]
|