This commit is contained in:
parent
8a4e59c556
commit
8f9bed48ca
|
|
@ -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"]
|
||||||
|
|
@ -86,5 +86,5 @@ with gr.Blocks(css=".gr-button {min-width:6rem}") as demo:
|
||||||
send_btn.click(send_emails, state_box, out_html)
|
send_btn.click(send_emails, state_box, out_html)
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
demo.queue().launch()
|
demo.queue().launch(server_port=7880)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue