varsshancoder commited on
Commit
447cb78
·
verified ·
1 Parent(s): 670fab0

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -5
Dockerfile CHANGED
@@ -1,5 +1,5 @@
1
- # Pre-configured image has build frameworks installed to skip compile timeouts
2
- FROM huggingface/transformers-cpu:latest
3
 
4
  ENV PYTHONUNBUFFERED=1 \
5
  HOME=/home/user \
@@ -8,14 +8,15 @@ ENV PYTHONUNBUFFERED=1 \
8
 
9
  WORKDIR $HOME
10
 
11
- # Create runtime cache paths with complete write permissions
12
  RUN mkdir -p /home/user/.cache && chmod -R 777 /home/user
13
 
14
  COPY requirements.txt .
15
- RUN pip install --no-cache-dir --upgrade -r requirements.txt
 
 
16
 
17
  COPY --chown=1000 . .
18
 
19
- # Expose port required by Hugging Face Spaces
20
  EXPOSE 7860
21
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # Use a clean, modern Python image to match newer packages
2
+ FROM python:3.10-slim
3
 
4
  ENV PYTHONUNBUFFERED=1 \
5
  HOME=/home/user \
 
8
 
9
  WORKDIR $HOME
10
 
11
+ # Set up standard permissions
12
  RUN mkdir -p /home/user/.cache && chmod -R 777 /home/user
13
 
14
  COPY requirements.txt .
15
+ # Install requirements safely using modern pip
16
+ RUN pip install --no-cache-dir --upgrade pip && \
17
+ pip install --no-cache-dir -r requirements.txt
18
 
19
  COPY --chown=1000 . .
20
 
 
21
  EXPOSE 7860
22
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]