CodeCommunity commited on
Commit
8b48ead
·
verified ·
1 Parent(s): 16fa6ee

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +4 -3
Dockerfile CHANGED
@@ -17,7 +17,7 @@ RUN apt-get update && apt-get install -y \
17
  build-essential \
18
  && rm -rf /var/lib/apt/lists/*
19
 
20
- # 5. Create a non-root user (Hugging Face Requirement)
21
  RUN useradd -m -u 1000 user
22
  RUN mkdir -p /code/.cache && chown -R user:user /code
23
 
@@ -31,8 +31,9 @@ RUN pip install --no-cache-dir --user --upgrade -r /code/requirements.txt
31
  # 8. Copy the entire project
32
  COPY --chown=user . /code
33
 
34
- # 9. Expose port 7860
35
- EXPOSE 7860
36
 
37
  # 10. Start the application
 
38
  CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
 
17
  build-essential \
18
  && rm -rf /var/lib/apt/lists/*
19
 
20
+ # 5. Create a non-root user (Hugging Face requirement)
21
  RUN useradd -m -u 1000 user
22
  RUN mkdir -p /code/.cache && chown -R user:user /code
23
 
 
31
  # 8. Copy the entire project
32
  COPY --chown=user . /code
33
 
34
+ # 9. Pre-download models during Build
35
+ RUN python -m app.setup_models
36
 
37
  # 10. Start the application
38
+ EXPOSE 7860
39
  CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]