This commit is contained in:
hailin 2025-07-21 19:03:12 +08:00
parent 8a4e59c556
commit 8f9bed48ca
2 changed files with 24 additions and 1 deletions

23
Dockerfile Normal file
View File

@ -0,0 +1,23 @@
# -------- Dockerfile (email_sender/Dockerfile) --------
FROM python:3.10-slim
# ---- 基础优化 ----
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1
WORKDIR /app
# 先装依赖,充分利用 Docker 缓存
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# 再放项目源代码
COPY . .
# ---- Gradio 运行参数 ----
ENV GRADIO_SERVER_PORT=7880 \
GRADIO_SERVER_NAME=0.0.0.0
EXPOSE 7880
CMD ["python", "email_ui.py"]

View File

@ -86,5 +86,5 @@ with gr.Blocks(css=".gr-button {min-width:6rem}") as demo:
send_btn.click(send_emails, state_box, out_html)
if __name__ == "__main__":
demo.queue().launch()
demo.queue().launch(server_port=7880)