arya123321 commited on
Commit
de5862e
·
1 Parent(s): 873a169
Files changed (2) hide show
  1. Dockerfile +5 -5
  2. requirements.txt +0 -0
Dockerfile CHANGED
@@ -6,8 +6,8 @@ RUN useradd -m -u 1000 user
6
  USER user
7
  ENV PATH="/home/user/.local/bin:$PATH"
8
 
9
- # Set environment variables for Hugging Face
10
- ENV TRANSFORMERS_CACHE=/app/cache
11
 
12
  # Set working directory
13
  WORKDIR /app
@@ -17,10 +17,10 @@ COPY --chown=user ./requirements.txt requirements.txt
17
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
18
 
19
  # Create cache directory for Hugging Face and ensure permissions
20
- RUN mkdir -p /app/cache && chown user:user /app/cache
21
 
22
  # Copy the rest of the application files
23
  COPY --chown=user . /app
24
 
25
- # Use uvicorn as recommended for Spaces
26
- CMD ["uvicorn", "chatbot:app", "--host", "0.0.0.0", "--port", "7860"]
 
6
  USER user
7
  ENV PATH="/home/user/.local/bin:$PATH"
8
 
9
+ # Set Hugging Face cache directory
10
+ ENV HF_HOME=/app/hf_cache
11
 
12
  # Set working directory
13
  WORKDIR /app
 
17
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
18
 
19
  # Create cache directory for Hugging Face and ensure permissions
20
+ RUN mkdir -p /app/hf_cache && chown user:user /app/hf_cache
21
 
22
  # Copy the rest of the application files
23
  COPY --chown=user . /app
24
 
25
+ # Use Gunicorn to serve the Flask app
26
+ CMD ["gunicorn", "--bind", "0.0.0.0:7860", "chatbot:app"]
requirements.txt CHANGED
Binary files a/requirements.txt and b/requirements.txt differ