NitinBot001 commited on
Commit
489f2f3
·
verified ·
1 Parent(s): c7c9999

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -8
Dockerfile CHANGED
@@ -1,9 +1,10 @@
1
- # Base image
2
  FROM python:3.10-slim
3
 
4
- # Set environment variables to writable paths
5
- ENV HF_HOME=/app/hf_cache
6
- ENV MPLCONFIGDIR=/app/mpl_config
 
7
 
8
  # Install OS packages
9
  RUN apt-get update && \
@@ -13,15 +14,15 @@ RUN apt-get update && \
13
  # Set working directory
14
  WORKDIR /app
15
 
16
- # Copy dependency list and install
17
  COPY requirements.txt .
18
  RUN pip install --no-cache-dir -r requirements.txt
19
 
20
- # Copy application code
21
  COPY . .
22
 
23
- # Expose API port
24
  EXPOSE 7860
25
 
26
- # Run FastAPI
27
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+
2
  FROM python:3.10-slim
3
 
4
+ # Set up writable cache paths
5
+ ENV HF_HOME=/root/.cache/huggingface
6
+ ENV TRANSFORMERS_CACHE=/root/.cache/huggingface
7
+ ENV MPLCONFIGDIR=/root/.config/matplotlib
8
 
9
  # Install OS packages
10
  RUN apt-get update && \
 
14
  # Set working directory
15
  WORKDIR /app
16
 
17
+ # Copy requirements and install
18
  COPY requirements.txt .
19
  RUN pip install --no-cache-dir -r requirements.txt
20
 
21
+ # Copy app code
22
  COPY . .
23
 
24
+ # Expose port
25
  EXPOSE 7860
26
 
27
+ # Run app
28
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]