LogicGoInfotechSpaces commited on
Commit
ca564e8
·
1 Parent(s): f7573cd

Spaces: switch to Docker SDK and serve FastAPI via uvicorn

Browse files
Files changed (2) hide show
  1. Dockerfile +26 -0
  2. README.md +1 -3
Dockerfile ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use slim Python base
2
+ FROM python:3.10-slim
3
+
4
+ ENV PYTHONDONTWRITEBYTECODE=1 \
5
+ PYTHONUNBUFFERED=1
6
+
7
+ WORKDIR /app
8
+
9
+ # System deps for OpenCV and PIL
10
+ RUN apt-get update && apt-get install -y --no-install-recommends \
11
+ build-essential \
12
+ ffmpeg \
13
+ libsm6 \
14
+ libxext6 \
15
+ && rm -rf /var/lib/apt/lists/*
16
+
17
+ # Copy project
18
+ COPY requirements.txt ./
19
+ RUN pip install --no-cache-dir -r requirements.txt
20
+ COPY . .
21
+
22
+ # Expose HF Spaces default port
23
+ EXPOSE 7860
24
+
25
+ # Start FastAPI
26
+ CMD ["python3", "-m", "uvicorn", "api.main:app", "--host", "0.0.0.0", "--port", "7860"]
README.md CHANGED
@@ -3,9 +3,7 @@ title: Remove Photo Object
3
  emoji: ⚡
4
  colorFrom: pink
5
  colorTo: purple
6
- sdk: streamlit
7
- sdk_version: "1.24.1"
8
- app_file: app.py
9
  pinned: false
10
  license: mit
11
  hardware: cpu-basic
 
3
  emoji: ⚡
4
  colorFrom: pink
5
  colorTo: purple
6
+ sdk: docker
 
 
7
  pinned: false
8
  license: mit
9
  hardware: cpu-basic