Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +18 -19
Dockerfile
CHANGED
|
@@ -1,28 +1,27 @@
|
|
| 1 |
-
FROM python:3.10
|
| 2 |
|
| 3 |
-
|
| 4 |
-
WORKDIR /ASF
|
| 5 |
|
| 6 |
-
#
|
| 7 |
-
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
-
|
| 11 |
-
RUN
|
|
|
|
|
|
|
| 12 |
USER user
|
| 13 |
|
| 14 |
-
# Set environment variables
|
| 15 |
ENV HOME=/home/user \
|
| 16 |
-
PATH=/
|
| 17 |
-
|
| 18 |
-
# Set the working directory for the app
|
| 19 |
-
WORKDIR $HOME/app
|
| 20 |
-
|
| 21 |
-
# Copy the application code into the container
|
| 22 |
-
COPY --chown=user . $HOME/app
|
| 23 |
|
| 24 |
-
|
| 25 |
-
COPY ./templates /home/user/app/templates
|
| 26 |
|
| 27 |
-
# Set the command to run the FastAPI app
|
| 28 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--root-path", "/"]
|
|
|
|
| 1 |
+
FROM python:3.10-slim
|
| 2 |
|
| 3 |
+
WORKDIR /home/user/app
|
|
|
|
| 4 |
|
| 5 |
+
# Install system dependencies
|
| 6 |
+
RUN apt-get update && apt-get install -y \
|
| 7 |
+
tesseract-ocr \
|
| 8 |
+
poppler-utils \
|
| 9 |
+
libglib2.0-0 \
|
| 10 |
+
libsm6 \
|
| 11 |
+
libxext6 \
|
| 12 |
+
libxrender-dev \
|
| 13 |
+
libmagic1 \
|
| 14 |
+
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
| 15 |
|
| 16 |
+
COPY requirements.txt ./requirements.txt
|
| 17 |
+
RUN pip install --no-cache-dir --upgrade pip && pip install --no-cache-dir -r requirements.txt
|
| 18 |
+
|
| 19 |
+
RUN useradd -ms /bin/bash user
|
| 20 |
USER user
|
| 21 |
|
|
|
|
| 22 |
ENV HOME=/home/user \
|
| 23 |
+
PATH=$HOME/.local/bin:$PATH
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
|
| 25 |
+
COPY --chown=user . .
|
|
|
|
| 26 |
|
|
|
|
| 27 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--root-path", "/"]
|