ChintanSatva commited on
Commit
50947d9
·
verified ·
1 Parent(s): 7866c2d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -6
Dockerfile CHANGED
@@ -2,7 +2,7 @@ FROM python:3.10-slim
2
 
3
  WORKDIR /app
4
 
5
- # Install system dependencies (none needed for categorization)
6
  RUN apt-get update && apt-get install -y \
7
  && rm -rf /var/lib/apt/lists/*
8
 
@@ -12,18 +12,19 @@ COPY requirements.txt .
12
  # Install Python dependencies
13
  RUN pip install --no-cache-dir -r requirements.txt
14
 
15
- # Create cache directory
16
- RUN mkdir -p /app/cache
17
 
18
  # Copy application code
19
- COPY app.py .
20
 
21
- # Set environment variables for cache
22
  ENV HF_HOME=/app/cache
23
  ENV NUMBA_CACHE_DIR=/app/cache
 
24
 
25
  # Expose port
26
  EXPOSE 7860
27
 
28
  # Run FastAPI with Uvicorn
29
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
2
 
3
  WORKDIR /app
4
 
5
+ # Install system dependencies (minimal)
6
  RUN apt-get update && apt-get install -y \
7
  && rm -rf /var/lib/apt/lists/*
8
 
 
12
  # Install Python dependencies
13
  RUN pip install --no-cache-dir -r requirements.txt
14
 
15
+ # Create cache directory with write permissions
16
+ RUN mkdir -p /app/cache/hub && chmod -R 777 /app/cache
17
 
18
  # Copy application code
19
+ COPY expense.py .
20
 
21
+ # Set environment variables
22
  ENV HF_HOME=/app/cache
23
  ENV NUMBA_CACHE_DIR=/app/cache
24
+ ENV TRANSFORMERS_CACHE=/app/cache
25
 
26
  # Expose port
27
  EXPOSE 7860
28
 
29
  # Run FastAPI with Uvicorn
30
+ CMD ["uvicorn", "expense:app", "--host", "0.0.0.0", "--port", "7860"]