koyu008 commited on
Commit
e879b18
·
verified ·
1 Parent(s): 4b02d4b

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +2 -4
Dockerfile CHANGED
@@ -1,16 +1,14 @@
1
  FROM python:3.9
2
 
3
- # Use root, no custom user
4
  WORKDIR /app
5
 
 
6
  ENV TRANSFORMERS_CACHE=/app/.hf_cache
 
7
 
8
- # Install all packages globally
9
  COPY requirements.txt requirements.txt
10
  RUN pip install --no-cache-dir -r requirements.txt
11
 
12
- # Copy code into container
13
  COPY . .
14
 
15
- # Start FastAPI with Uvicorn (now installed globally)
16
  CMD ["python", "-m", "uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
  FROM python:3.9
2
 
 
3
  WORKDIR /app
4
 
5
+ # Set cache dir and create it with proper permissions
6
  ENV TRANSFORMERS_CACHE=/app/.hf_cache
7
+ RUN mkdir -p /app/.hf_cache && chmod -R 777 /app/.hf_cache
8
 
 
9
  COPY requirements.txt requirements.txt
10
  RUN pip install --no-cache-dir -r requirements.txt
11
 
 
12
  COPY . .
13
 
 
14
  CMD ["python", "-m", "uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]