Percy3822 commited on
Commit
783a8d5
·
verified ·
1 Parent(s): 6232d77

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -9
Dockerfile CHANGED
@@ -1,29 +1,27 @@
1
- # 2) Dockerfile (paste as a new file)
2
-
3
- ```dockerfile
4
  FROM python:3.10-slim
5
 
6
- # Avoid interactive tzdata etc.
7
  ENV DEBIAN_FRONTEND=noninteractive \
8
  PYTHONDONTWRITEBYTECODE=1 \
9
  PYTHONUNBUFFERED=1
10
 
11
- # System deps (optional but useful for some libs)
12
  RUN apt-get update && apt-get install -y --no-install-recommends \
13
  build-essential curl && \
14
  rm -rf /var/lib/apt/lists/*
15
 
 
16
  WORKDIR /code
17
 
18
- # Install Python deps first (cached layer)
19
  COPY requirements.txt .
20
  RUN pip install --no-cache-dir -r requirements.txt
21
 
22
- # Copy app files
23
  COPY . .
24
 
25
- # Expose HF Spaces default port
26
  EXPOSE 7860
27
 
28
- # Start FastAPI with uvicorn
29
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
 
 
1
  FROM python:3.10-slim
2
 
3
+ # Environment settings
4
  ENV DEBIAN_FRONTEND=noninteractive \
5
  PYTHONDONTWRITEBYTECODE=1 \
6
  PYTHONUNBUFFERED=1
7
 
8
+ # System dependencies
9
  RUN apt-get update && apt-get install -y --no-install-recommends \
10
  build-essential curl && \
11
  rm -rf /var/lib/apt/lists/*
12
 
13
+ # Set work directory
14
  WORKDIR /code
15
 
16
+ # Install Python dependencies
17
  COPY requirements.txt .
18
  RUN pip install --no-cache-dir -r requirements.txt
19
 
20
+ # Copy the rest of the app
21
  COPY . .
22
 
23
+ # Expose Hugging Face default port
24
  EXPOSE 7860
25
 
26
+ # Start FastAPI app with uvicorn
27
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]