Corin1998 commited on
Commit
e718cfb
·
verified ·
1 Parent(s): 403c37c

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -0
Dockerfile ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Dockerfile
2
+ FROM python:3.11-slim
3
+
4
+ ENV PYTHONDONTWRITEBYTECODE=1 \
5
+ PYTHONUNBUFFERED=1
6
+
7
+ WORKDIR /app
8
+ COPY requirements.txt ./
9
+ RUN pip install --no-cache-dir -r requirements.txt
10
+
11
+ COPY . /app
12
+
13
+ # HF Spaces は $PORT を割り当てるのでそれを使う
14
+ ENV PORT=7860
15
+ EXPOSE 7860
16
+
17
+ # 本番は --host 0.0.0.0 --port $PORT で待ち受け
18
+ CMD ["sh", "-c", "uvicorn main:app --host 0.0.0.0 --port $PORT"]