Spaces:
Sleeping
Sleeping
msmhmorsi
commited on
Commit
·
756da27
1
Parent(s):
3ca2be5
fixed dockerfile
Browse files- Dockerfile +8 -8
Dockerfile
CHANGED
|
@@ -1,15 +1,15 @@
|
|
| 1 |
# Use the official Python image from the Docker Hub
|
| 2 |
FROM python:3.9
|
| 3 |
|
| 4 |
-
RUN useradd -m -u 1000 user
|
| 5 |
-
USER user
|
| 6 |
-
ENV PATH="/home/user/.local/bin:$PATH"
|
| 7 |
-
|
| 8 |
-
|
| 9 |
# Install system dependencies for OpenCV
|
| 10 |
RUN apt-get update && apt-get install -y \
|
| 11 |
libgl1-mesa-glx \
|
| 12 |
-
&& apt-get clean
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
# Set the working directory in the container
|
| 15 |
WORKDIR /app
|
|
@@ -21,6 +21,6 @@ COPY --chown=user ./requirements.txt requirements.txt
|
|
| 21 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 22 |
|
| 23 |
# Copy the rest of the application code
|
| 24 |
-
COPY . /app
|
| 25 |
|
| 26 |
-
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 1 |
# Use the official Python image from the Docker Hub
|
| 2 |
FROM python:3.9
|
| 3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
# Install system dependencies for OpenCV
|
| 5 |
RUN apt-get update && apt-get install -y \
|
| 6 |
libgl1-mesa-glx \
|
| 7 |
+
&& apt-get clean \
|
| 8 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 9 |
+
|
| 10 |
+
RUN useradd -m -u 1000 user
|
| 11 |
+
USER user
|
| 12 |
+
ENV PATH="/home/user/.local/bin:$PATH"
|
| 13 |
|
| 14 |
# Set the working directory in the container
|
| 15 |
WORKDIR /app
|
|
|
|
| 21 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 22 |
|
| 23 |
# Copy the rest of the application code
|
| 24 |
+
COPY --chown=user . /app
|
| 25 |
|
| 26 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|