dpv007 commited on
Commit
1bd5bd0
·
verified ·
1 Parent(s): f9f5609

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -8
Dockerfile CHANGED
@@ -1,18 +1,21 @@
1
  FROM python:3.11-slim
2
 
3
- WORKDIR /code
 
 
 
 
 
 
 
 
4
 
5
- # Install dependencies
6
  COPY requirements.txt .
7
  RUN pip install --no-cache-dir -r requirements.txt
8
 
9
- # Copy the rest of the app
10
- COPY . .
11
 
12
- # HF will inject PORT, but we set a default
13
  ENV PORT=7860
14
-
15
  EXPOSE 7860
16
 
17
- # Use $PORT from the environment (Spaces sets it)
18
- CMD ["sh", "-c", "uvicorn main:app --host 0.0.0.0 --port ${PORT}"]
 
1
  FROM python:3.11-slim
2
 
3
+ ENV PYTHONDONTWRITEBYTECODE=1
4
+ ENV PYTHONUNBUFFERED=1
5
+
6
+ WORKDIR /app
7
+
8
+ # System deps (optional but useful)
9
+ RUN apt-get update && apt-get install -y --no-install-recommends \
10
+ build-essential \
11
+ && rm -rf /var/lib/apt/lists/*
12
 
 
13
  COPY requirements.txt .
14
  RUN pip install --no-cache-dir -r requirements.txt
15
 
16
+ COPY app.py .
 
17
 
 
18
  ENV PORT=7860
 
19
  EXPOSE 7860
20
 
21
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]