service-internal commited on
Commit
86b6cd2
·
verified ·
1 Parent(s): abe9c4b

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -6
Dockerfile CHANGED
@@ -1,18 +1,17 @@
1
  FROM python:3.10-slim
2
 
3
- # Prevent Python from writing .pyc files and using buffered output
4
  ENV PYTHONDONTWRITEBYTECODE=1
5
  ENV PYTHONUNBUFFERED=1
 
6
 
7
- # Set working directory
8
  WORKDIR /app
9
 
10
- # Install dependencies
11
  COPY requirements.txt .
12
  RUN pip install --upgrade pip && pip install -r requirements.txt
13
 
14
- # Copy source code
15
  COPY main.py .
16
 
17
- # Run the app with Uvicorn
18
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
 
 
 
1
  FROM python:3.10-slim
2
 
 
3
  ENV PYTHONDONTWRITEBYTECODE=1
4
  ENV PYTHONUNBUFFERED=1
5
+ ENV TRANSFORMERS_CACHE=/app/hf_cache
6
 
 
7
  WORKDIR /app
8
 
 
9
  COPY requirements.txt .
10
  RUN pip install --upgrade pip && pip install -r requirements.txt
11
 
 
12
  COPY main.py .
13
 
14
+ # Ensure cache directory exists
15
+ RUN mkdir -p /app/hf_cache
16
+
17
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]