Spaces:
Paused
Paused
Update Dockerfile
Browse files- Dockerfile +6 -4
Dockerfile
CHANGED
|
@@ -4,7 +4,8 @@ FROM python:3.11-slim-bullseye
|
|
| 4 |
# Set environment variables
|
| 5 |
ENV PYTHONUNBUFFERED=1 \
|
| 6 |
PYTHONIOENCODING=UTF-8 \
|
| 7 |
-
TESSERACT_PATH="/usr/bin/tesseract"
|
|
|
|
| 8 |
|
| 9 |
# Set the working directory
|
| 10 |
WORKDIR /app
|
|
@@ -16,14 +17,15 @@ RUN apt-get update && apt-get install -y \
|
|
| 16 |
libgl1 \
|
| 17 |
&& rm -rf /var/lib/apt/lists/*
|
| 18 |
|
|
|
|
|
|
|
|
|
|
| 19 |
# Copy application files
|
| 20 |
COPY . /app
|
| 21 |
|
| 22 |
# Install Python dependencies
|
| 23 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 24 |
|
| 25 |
-
# Expose port 80 for the application
|
| 26 |
-
EXPOSE 80
|
| 27 |
|
| 28 |
# Start the application with Gunicorn
|
| 29 |
-
CMD ["gunicorn", "-b", "0.0.0.0:7860", "--timeout", "300", "app:app"]
|
|
|
|
| 4 |
# Set environment variables
|
| 5 |
ENV PYTHONUNBUFFERED=1 \
|
| 6 |
PYTHONIOENCODING=UTF-8 \
|
| 7 |
+
TESSERACT_PATH="/usr/bin/tesseract" \
|
| 8 |
+
TRANSFORMERS_CACHE="/app/cache"
|
| 9 |
|
| 10 |
# Set the working directory
|
| 11 |
WORKDIR /app
|
|
|
|
| 17 |
libgl1 \
|
| 18 |
&& rm -rf /var/lib/apt/lists/*
|
| 19 |
|
| 20 |
+
# Ensure cache directory exists with correct permissions
|
| 21 |
+
RUN mkdir -p /app/cache && chmod -R 777 /app/cache
|
| 22 |
+
|
| 23 |
# Copy application files
|
| 24 |
COPY . /app
|
| 25 |
|
| 26 |
# Install Python dependencies
|
| 27 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 28 |
|
|
|
|
|
|
|
| 29 |
|
| 30 |
# Start the application with Gunicorn
|
| 31 |
+
CMD ["gunicorn", "-b", "0.0.0.0:7860", "--timeout", "300", "app:app"]
|