prarabdha21 commited on
Commit
57a8f55
·
1 Parent(s): 331b148
Files changed (1) hide show
  1. dockerfile +8 -8
dockerfile CHANGED
@@ -1,23 +1,23 @@
1
- # Use a Python base image
2
  FROM python:3.9
3
 
4
- # Create a user and set up environment
5
  RUN useradd -m -u 1000 user
6
  USER user
7
  ENV PATH="/home/user/.local/bin:$PATH"
 
8
 
9
  # Set working directory
10
  WORKDIR /app
11
 
12
- # Copy and install dependencies
13
- COPY --chown=user ./requirements.txt requirements.txt
14
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
15
 
16
- # Copy the application code
17
- COPY --chown=user . /app
18
 
19
- # Expose port (optional, usually HF Spaces handles this)
20
  EXPOSE 7860
21
 
22
- # Run the application
23
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
1
  FROM python:3.9
2
 
3
+ # Create user and environment
4
  RUN useradd -m -u 1000 user
5
  USER user
6
  ENV PATH="/home/user/.local/bin:$PATH"
7
+ ENV HF_HOME="/home/user/.cache/huggingface"
8
 
9
  # Set working directory
10
  WORKDIR /app
11
 
12
+ # Install dependencies
13
+ COPY ./requirements.txt requirements.txt
14
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
15
 
16
+ # Copy code
17
+ COPY . /app
18
 
19
+ # Expose port
20
  EXPOSE 7860
21
 
22
+ # Run FastAPI app
23
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]