Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +8 -5
Dockerfile
CHANGED
|
@@ -1,12 +1,15 @@
|
|
| 1 |
# Use the official Python 3.10.9 image
|
| 2 |
FROM python:3.10.9
|
| 3 |
|
| 4 |
-
# Copy the current directory contents into the container at
|
| 5 |
-
COPY .
|
|
|
|
| 6 |
# Install dependencies for OpenCV and other requirements
|
| 7 |
RUN apt-get update && apt-get install -y libgl1 libglib2.0-0 curl
|
|
|
|
| 8 |
# Set the working directory to /
|
| 9 |
WORKDIR /
|
|
|
|
| 10 |
# Create a user to avoid permission issues
|
| 11 |
RUN useradd -m appuser
|
| 12 |
USER appuser
|
|
@@ -17,8 +20,8 @@ WORKDIR /home/appuser
|
|
| 17 |
# Add /home/appuser/.local/bin to PATH
|
| 18 |
ENV PATH="/home/appuser/.local/bin:${PATH}"
|
| 19 |
|
| 20 |
-
# Install requirements.txt
|
| 21 |
RUN pip install --no-cache-dir --upgrade -r /requirements.txt
|
| 22 |
|
| 23 |
-
# Start the FastAPI app
|
| 24 |
-
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 1 |
# Use the official Python 3.10.9 image
|
| 2 |
FROM python:3.10.9
|
| 3 |
|
| 4 |
+
# Copy the current directory contents into the container at /
|
| 5 |
+
COPY . /
|
| 6 |
+
|
| 7 |
# Install dependencies for OpenCV and other requirements
|
| 8 |
RUN apt-get update && apt-get install -y libgl1 libglib2.0-0 curl
|
| 9 |
+
|
| 10 |
# Set the working directory to /
|
| 11 |
WORKDIR /
|
| 12 |
+
|
| 13 |
# Create a user to avoid permission issues
|
| 14 |
RUN useradd -m appuser
|
| 15 |
USER appuser
|
|
|
|
| 20 |
# Add /home/appuser/.local/bin to PATH
|
| 21 |
ENV PATH="/home/appuser/.local/bin:${PATH}"
|
| 22 |
|
| 23 |
+
# Install requirements.txt
|
| 24 |
RUN pip install --no-cache-dir --upgrade -r /requirements.txt
|
| 25 |
|
| 26 |
+
# Start the FastAPI app
|
| 27 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|