File size: 692 Bytes
effe6e2
 
ec37931
effe6e2
 
 
9891589
effe6e2
 
ec37931
 
 
effe6e2
ec37931
 
effe6e2
ec37931
 
effe6e2
 
ec37931
effe6e2
dbd9be6
effe6e2
ec37931
 
effe6e2
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
FROM python:3.10-slim

# 環境變數
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1


WORKDIR /app

# 安裝系統依賴與 Node.js(React 前端需要)
RUN apt-get update && \
    apt-get install -y build-essential curl && \
    curl -fsSL https://deb.nodesource.com/setup_18.x | bash - && \
    apt-get install -y nodejs && \
    rm -rf /var/lib/apt/lists/*

# 安裝 Python 套件
COPY requirements.txt .
RUN pip install --upgrade pip && pip install -r requirements.txt

# 複製所有檔案(包含 build/ 資料夾)
COPY . .


# TOGETHER API KEY
ENV TOGETHER_API_KEY=${TOGETHER_API_KEY}

EXPOSE 7860
CMD ["uvicorn", "api_service:app", "--host", "0.0.0.0", "--port", "7860"]