borndeveloper commited on
Commit
8a5bc1d
·
1 Parent(s): 730f191

fix: use python -m uvicorn

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -14
Dockerfile CHANGED
@@ -1,26 +1,17 @@
1
  FROM python:3.11-slim
2
 
3
- # Install Node.js for building static frontend if needed in future
4
- RUN apt-get update && apt-get install -y curl && \
5
- curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
6
- apt-get install -y nodejs && \
7
- rm -rf /var/lib/apt/lists/*
8
-
9
- # Create user for security
10
- RUN useradd -m -u 1000 user
11
- USER user
12
-
13
  WORKDIR /app
14
 
15
  # Copy requirements and install Python dependencies
16
- COPY --chown=user requirements.txt .
17
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
18
 
19
  # Copy application
20
- COPY --chown=user app.py .
21
- COPY --chown=user data ./data
22
 
23
  # Expose Hugging Face required port
24
  EXPOSE 7860
25
 
26
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
1
  FROM python:3.11-slim
2
 
 
 
 
 
 
 
 
 
 
 
3
  WORKDIR /app
4
 
5
  # Copy requirements and install Python dependencies
6
+ COPY requirements.txt .
7
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
8
 
9
  # Copy application
10
+ COPY app.py .
11
+ COPY data ./data
12
 
13
  # Expose Hugging Face required port
14
  EXPOSE 7860
15
 
16
+ # Use python -m uvicorn to ensure PATH is found
17
+ CMD ["python", "-m", "uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]