varsshancoder commited on
Commit
670fab0
·
verified ·
1 Parent(s): 28a32cb

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +3 -4
Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- # Use an optimized official Hugging Face base layer to resolve internal build errors
2
  FROM huggingface/transformers-cpu:latest
3
 
4
  ENV PYTHONUNBUFFERED=1 \
@@ -8,7 +8,7 @@ ENV PYTHONUNBUFFERED=1 \
8
 
9
  WORKDIR $HOME
10
 
11
- # Set up access permissions cleanly
12
  RUN mkdir -p /home/user/.cache && chmod -R 777 /home/user
13
 
14
  COPY requirements.txt .
@@ -16,7 +16,6 @@ RUN pip install --no-cache-dir --upgrade -r requirements.txt
16
 
17
  COPY --chown=1000 . .
18
 
 
19
  EXPOSE 7860
20
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
21
-
22
-
 
1
+ # Pre-configured image has build frameworks installed to skip compile timeouts
2
  FROM huggingface/transformers-cpu:latest
3
 
4
  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 .
 
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"]