Spaces:
Runtime error
Runtime error
Praful Nayak
commited on
Commit
·
8cf911d
1
Parent(s):
bf65784
Deploy Flask Summarization App
Browse files- Dockerfile +10 -10
Dockerfile
CHANGED
|
@@ -1,15 +1,7 @@
|
|
| 1 |
# Use a lightweight Python image
|
| 2 |
FROM python:3.9-slim
|
| 3 |
|
| 4 |
-
#
|
| 5 |
-
RUN useradd -m -u 1000 user
|
| 6 |
-
USER user
|
| 7 |
-
ENV PATH="/home/user/.local/bin:$PATH"
|
| 8 |
-
|
| 9 |
-
# Set working directory
|
| 10 |
-
WORKDIR /app
|
| 11 |
-
|
| 12 |
-
# Install system dependencies for pdfplumber and pytesseract
|
| 13 |
RUN apt-get update && apt-get install -y \
|
| 14 |
libpng-dev \
|
| 15 |
libjpeg-dev \
|
|
@@ -18,7 +10,15 @@ RUN apt-get update && apt-get install -y \
|
|
| 18 |
libtesseract-dev \
|
| 19 |
&& rm -rf /var/lib/apt/lists/*
|
| 20 |
|
| 21 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
COPY --chown=user:user requirements.txt requirements.txt
|
| 23 |
RUN pip install --no-cache-dir --upgrade pip && \
|
| 24 |
pip install --no-cache-dir -r requirements.txt
|
|
|
|
| 1 |
# Use a lightweight Python image
|
| 2 |
FROM python:3.9-slim
|
| 3 |
|
| 4 |
+
# Install system dependencies as root
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
RUN apt-get update && apt-get install -y \
|
| 6 |
libpng-dev \
|
| 7 |
libjpeg-dev \
|
|
|
|
| 10 |
libtesseract-dev \
|
| 11 |
&& rm -rf /var/lib/apt/lists/*
|
| 12 |
|
| 13 |
+
# Create a non-root user and set environment
|
| 14 |
+
RUN useradd -m -u 1000 user
|
| 15 |
+
USER user
|
| 16 |
+
ENV PATH="/home/user/.local/bin:$PATH"
|
| 17 |
+
|
| 18 |
+
# Set working directory
|
| 19 |
+
WORKDIR /app
|
| 20 |
+
|
| 21 |
+
# Copy requirements file and install Python dependencies as user
|
| 22 |
COPY --chown=user:user requirements.txt requirements.txt
|
| 23 |
RUN pip install --no-cache-dir --upgrade pip && \
|
| 24 |
pip install --no-cache-dir -r requirements.txt
|