Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +8 -8
Dockerfile
CHANGED
|
@@ -3,11 +3,11 @@ FROM python:3.10-slim
|
|
| 3 |
# Set working directory
|
| 4 |
WORKDIR /app
|
| 5 |
|
| 6 |
-
#
|
| 7 |
ENV PYTHONDONTWRITEBYTECODE=1
|
| 8 |
ENV PYTHONUNBUFFERED=1
|
| 9 |
|
| 10 |
-
#
|
| 11 |
RUN apt-get update && apt-get install -y \
|
| 12 |
build-essential \
|
| 13 |
libglib2.0-0 \
|
|
@@ -17,14 +17,14 @@ RUN apt-get update && apt-get install -y \
|
|
| 17 |
libgl1 \
|
| 18 |
&& rm -rf /var/lib/apt/lists/*
|
| 19 |
|
| 20 |
-
# Copy
|
| 21 |
COPY . .
|
| 22 |
-
WORKDIR /app
|
| 23 |
-
COPY 3.keras /app/
|
| 24 |
-
RUN chmod 644 /app/2.keras
|
| 25 |
|
| 26 |
-
# Set
|
|
|
|
| 27 |
|
|
|
|
|
|
|
| 28 |
|
| 29 |
# Install Python dependencies
|
| 30 |
RUN pip install --no-cache-dir --upgrade pip \
|
|
@@ -33,5 +33,5 @@ RUN pip install --no-cache-dir --upgrade pip \
|
|
| 33 |
# Expose port
|
| 34 |
EXPOSE 7860
|
| 35 |
|
| 36 |
-
#
|
| 37 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 3 |
# Set working directory
|
| 4 |
WORKDIR /app
|
| 5 |
|
| 6 |
+
# Prevent .pyc files
|
| 7 |
ENV PYTHONDONTWRITEBYTECODE=1
|
| 8 |
ENV PYTHONUNBUFFERED=1
|
| 9 |
|
| 10 |
+
# Install system dependencies
|
| 11 |
RUN apt-get update && apt-get install -y \
|
| 12 |
build-essential \
|
| 13 |
libglib2.0-0 \
|
|
|
|
| 17 |
libgl1 \
|
| 18 |
&& rm -rf /var/lib/apt/lists/*
|
| 19 |
|
| 20 |
+
# Copy all project files including .keras
|
| 21 |
COPY . .
|
|
|
|
|
|
|
|
|
|
| 22 |
|
| 23 |
+
# Set read permissions explicitly
|
| 24 |
+
RUN chmod 644 /app/3.keras
|
| 25 |
|
| 26 |
+
# Or if you placed it inside a folder like /app/models
|
| 27 |
+
# RUN chmod 644 /app/models/3.keras
|
| 28 |
|
| 29 |
# Install Python dependencies
|
| 30 |
RUN pip install --no-cache-dir --upgrade pip \
|
|
|
|
| 33 |
# Expose port
|
| 34 |
EXPOSE 7860
|
| 35 |
|
| 36 |
+
# Start app
|
| 37 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|