Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +3 -14
Dockerfile
CHANGED
|
@@ -22,18 +22,11 @@ COPY requirements.txt .
|
|
| 22 |
# Install Python dependencies in optimized batches (as per reference style)
|
| 23 |
# Note: Removed OpenCV/YOLO dependencies as they are not needed for this project
|
| 24 |
RUN pip install --no-cache-dir --timeout=1000 \
|
| 25 |
-
|
| 26 |
-
uvicorn[standard]>=0.24.0 \
|
| 27 |
-
pydantic>=2.0.0 \
|
| 28 |
-
aiofiles
|
| 29 |
|
| 30 |
# Copy application files explicitly
|
| 31 |
-
COPY
|
| 32 |
-
|
| 33 |
-
COPY config.py .
|
| 34 |
-
COPY index.html .
|
| 35 |
-
COPY style.css .
|
| 36 |
-
COPY script.js .
|
| 37 |
|
| 38 |
# Create a non-privileged user for security
|
| 39 |
RUN useradd -m -u 1000 user
|
|
@@ -43,9 +36,5 @@ USER user
|
|
| 43 |
# Expose port 8000
|
| 44 |
EXPOSE 7860
|
| 45 |
|
| 46 |
-
# Health check (as per reference)
|
| 47 |
-
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
| 48 |
-
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:7860/')" || exit 1
|
| 49 |
-
|
| 50 |
# Run the application
|
| 51 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 22 |
# Install Python dependencies in optimized batches (as per reference style)
|
| 23 |
# Note: Removed OpenCV/YOLO dependencies as they are not needed for this project
|
| 24 |
RUN pip install --no-cache-dir --timeout=1000 \
|
| 25 |
+
-r requirements.txt
|
|
|
|
|
|
|
|
|
|
| 26 |
|
| 27 |
# Copy application files explicitly
|
| 28 |
+
COPY . .
|
| 29 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
|
| 31 |
# Create a non-privileged user for security
|
| 32 |
RUN useradd -m -u 1000 user
|
|
|
|
| 36 |
# Expose port 8000
|
| 37 |
EXPOSE 7860
|
| 38 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 39 |
# Run the application
|
| 40 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|