Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +8 -5
Dockerfile
CHANGED
@@ -5,16 +5,16 @@ FROM python:3.9
|
|
5 |
WORKDIR /app
|
6 |
|
7 |
# Set environment variables for Hugging Face cache
|
8 |
-
ENV HF_HOME=/
|
9 |
-
RUN mkdir -p /
|
10 |
|
11 |
# Install system dependencies
|
12 |
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
|
13 |
|
14 |
# Install Python dependencies
|
15 |
-
COPY requirements.txt
|
16 |
-
RUN pip install --no-cache-dir --upgrade pip
|
17 |
-
|
18 |
|
19 |
# Copy the application code
|
20 |
COPY . .
|
@@ -22,5 +22,8 @@ COPY . .
|
|
22 |
# Expose the port for running the app (modify if needed)
|
23 |
EXPOSE 7860
|
24 |
|
|
|
|
|
|
|
25 |
# Run the application
|
26 |
CMD ["python", "app.py"]
|
|
|
5 |
WORKDIR /app
|
6 |
|
7 |
# Set environment variables for Hugging Face cache
|
8 |
+
ENV HF_HOME=/root/.cache/huggingface/
|
9 |
+
RUN mkdir -p /root/.cache/huggingface/ && chmod -R 777 /root/.cache/huggingface/
|
10 |
|
11 |
# Install system dependencies
|
12 |
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
|
13 |
|
14 |
# Install Python dependencies
|
15 |
+
COPY requirements.txt .
|
16 |
+
RUN pip install --no-cache-dir --upgrade pip && \
|
17 |
+
pip install --no-cache-dir -r requirements.txt
|
18 |
|
19 |
# Copy the application code
|
20 |
COPY . .
|
|
|
22 |
# Expose the port for running the app (modify if needed)
|
23 |
EXPOSE 7860
|
24 |
|
25 |
+
# Ensure the script is executable
|
26 |
+
RUN chmod +x /app/app.py
|
27 |
+
|
28 |
# Run the application
|
29 |
CMD ["python", "app.py"]
|