Spaces:
Running
Running
File size: 714 Bytes
4ad7e37 33df804 4ad7e37 ffae8c1 4ad7e37 33df804 4ad7e37 | 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 | # 使用 Python 基礎映像
FROM python:3.10-slim
# 設置工作目錄
WORKDIR /app
# 更新 apt 並安裝 Pandoc 和其他必要的套件
RUN apt-get update && \
apt-get install -y pandoc libreoffice python3-uno fonts-noto-cjk libreoffice-impress poppler-utils fonts-dejavu && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# 先安裝鎖定版本,讓 Hugging Face rebuild 可重現。
COPY requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# 複製當前目錄下的檔案到容器中
COPY . /app
# 開放 Gradio 預設的埠
EXPOSE 7860
# 設置環境變數
ENV GRADIO_SERVER_NAME="0.0.0.0"
# 設置執行程式的命令
CMD ["python", "main.py"]
|