ethnmcl commited on
Commit
8d804b5
·
verified ·
1 Parent(s): ffcb517

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +26 -0
Dockerfile ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Dockerfile for a Hugging Face Space API (FastAPI)
2
+ FROM python:3.11-slim
3
+
4
+ ENV PIP_NO_CACHE_DIR=1 \
5
+ PYTHONDONTWRITEBYTECODE=1 \
6
+ PYTHONUNBUFFERED=1
7
+
8
+ # System deps
9
+ RUN apt-get update && apt-get install -y --no-install-recommends \
10
+ git \
11
+ && rm -rf /var/lib/apt/lists/*
12
+
13
+ # Copy & install
14
+ WORKDIR /app
15
+ COPY requirements.txt /app/requirements.txt
16
+ RUN pip install -r /app/requirements.txt
17
+
18
+ # Copy app
19
+ COPY main.py /app/main.py
20
+
21
+ # Spaces default port
22
+ EXPOSE 7860
23
+ ENV PORT=7860
24
+
25
+ # Start FastAPI with uvicorn
26
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]