vip11017 commited on
Commit
2ebb2cd
·
verified ·
1 Parent(s): 62d3f84

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -3
Dockerfile CHANGED
@@ -1,19 +1,26 @@
1
  FROM python:3.11-slim
2
 
 
 
 
 
3
  RUN apt-get update && apt-get install -y \
4
  git \
5
  curl \
6
  && rm -rf /var/lib/apt/lists/*
7
 
 
8
  WORKDIR /code
9
 
10
- ENV HF_HOME=/code/cache
11
-
12
  COPY ./app /code/app
13
  COPY requirements.txt .
14
 
 
15
  RUN pip install --no-cache-dir -r requirements.txt
16
 
 
17
  EXPOSE 7860
18
 
19
- CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
1
  FROM python:3.11-slim
2
 
3
+ # Avoid Hugging Face cache permission errors
4
+ ENV HF_HOME=/tmp/hf-cache
5
+
6
+ # Install necessary system dependencies
7
  RUN apt-get update && apt-get install -y \
8
  git \
9
  curl \
10
  && rm -rf /var/lib/apt/lists/*
11
 
12
+ # Set working directory
13
  WORKDIR /code
14
 
15
+ # Copy application and requirements
 
16
  COPY ./app /code/app
17
  COPY requirements.txt .
18
 
19
+ # Install Python dependencies
20
  RUN pip install --no-cache-dir -r requirements.txt
21
 
22
+ # Expose the FastAPI port
23
  EXPOSE 7860
24
 
25
+ # Run the FastAPI app
26
+ CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]