Spaces:
Sleeping
Sleeping
Upload 2 files
Browse files- Dockerfile +7 -5
- requirements.txt +0 -1
Dockerfile
CHANGED
|
@@ -9,14 +9,18 @@ RUN useradd -m -u 1000 user
|
|
| 9 |
ENV HOME=/home/user
|
| 10 |
ENV PATH="/home/user/.local/bin:$PATH"
|
| 11 |
|
| 12 |
-
# Set working directory
|
| 13 |
-
WORKDIR /home/user/app
|
| 14 |
-
|
| 15 |
# Install system dependencies
|
| 16 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 17 |
build-essential \
|
| 18 |
&& rm -rf /var/lib/apt/lists/*
|
| 19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
# Copy requirements first for better layer caching
|
| 21 |
COPY --chown=user:user requirements.txt .
|
| 22 |
|
|
@@ -32,8 +36,6 @@ RUN pip install --no-cache-dir --upgrade pip && \
|
|
| 32 |
COPY --chown=user:user heal.py .
|
| 33 |
COPY --chown=user:user models/ ./models/
|
| 34 |
|
| 35 |
-
# Create directories needed at runtime
|
| 36 |
-
RUN mkdir -p experience_logs
|
| 37 |
|
| 38 |
# Expose the Hugging Face Spaces default port
|
| 39 |
EXPOSE 7860
|
|
|
|
| 9 |
ENV HOME=/home/user
|
| 10 |
ENV PATH="/home/user/.local/bin:$PATH"
|
| 11 |
|
|
|
|
|
|
|
|
|
|
| 12 |
# Install system dependencies
|
| 13 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 14 |
build-essential \
|
| 15 |
&& rm -rf /var/lib/apt/lists/*
|
| 16 |
|
| 17 |
+
# Set working directory and ensure user owns it
|
| 18 |
+
WORKDIR /home/user/app
|
| 19 |
+
RUN chown -R user:user /home/user/app
|
| 20 |
+
|
| 21 |
+
# Create directories needed at runtime (while still root)
|
| 22 |
+
RUN mkdir -p experience_logs && chown -R user:user experience_logs
|
| 23 |
+
|
| 24 |
# Copy requirements first for better layer caching
|
| 25 |
COPY --chown=user:user requirements.txt .
|
| 26 |
|
|
|
|
| 36 |
COPY --chown=user:user heal.py .
|
| 37 |
COPY --chown=user:user models/ ./models/
|
| 38 |
|
|
|
|
|
|
|
| 39 |
|
| 40 |
# Expose the Hugging Face Spaces default port
|
| 41 |
EXPOSE 7860
|
requirements.txt
CHANGED
|
@@ -1,4 +1,3 @@
|
|
| 1 |
flask==3.1.0
|
| 2 |
-
torch==2.6.0
|
| 3 |
numpy==2.2.3
|
| 4 |
gunicorn==23.0.0
|
|
|
|
| 1 |
flask==3.1.0
|
|
|
|
| 2 |
numpy==2.2.3
|
| 3 |
gunicorn==23.0.0
|