saad003 commited on
Commit
1ea22f4
·
verified ·
1 Parent(s): 9d09f0b

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +3 -4
Dockerfile CHANGED
@@ -1,18 +1,17 @@
1
- # Dockerfile
2
  FROM python:3.10
3
 
4
- # Create non-root user (as HF recommends)
5
  RUN useradd -m -u 1000 user
6
  USER user
7
  ENV PATH="/home/user/.local/bin:$PATH"
8
  WORKDIR /app
9
 
10
- # Copy and install requirements
11
  COPY --chown=user requirements.txt /app/requirements.txt
12
  RUN pip install --no-cache-dir -r requirements.txt
13
 
14
  # Copy app code
15
  COPY --chown=user . /app
16
 
17
- # Run FastAPI app on port 7860 (required by Spaces)
18
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
1
  FROM python:3.10
2
 
3
+ # Create non-root user (recommended by HF)
4
  RUN useradd -m -u 1000 user
5
  USER user
6
  ENV PATH="/home/user/.local/bin:$PATH"
7
  WORKDIR /app
8
 
9
+ # Install dependencies
10
  COPY --chown=user requirements.txt /app/requirements.txt
11
  RUN pip install --no-cache-dir -r requirements.txt
12
 
13
  # Copy app code
14
  COPY --chown=user . /app
15
 
16
+ # Run FastAPI on port 7860 (required by HF Spaces)
17
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]