mike23415 commited on
Commit
27ce70f
·
verified ·
1 Parent(s): 17c487a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. 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=/tmp/cache
9
- RUN mkdir -p /tmp/cache && chmod 777 /tmp/cache
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 requirements.txt
16
- RUN pip install --no-cache-dir --upgrade pip
17
- RUN pip install --no-cache-dir -r requirements.txt
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"]