File size: 642 Bytes
1705293
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
FROM python:3.9-slim

# 设置工作目录
WORKDIR /app

# 复制依赖文件
COPY requirements.txt .

# 安装 gunicorn 和其他依赖
RUN pip install --upgrade pip && \
    pip install --no-cache-dir -r requirements.txt gunicorn

# 复制应用程序文件和模板
COPY app.py .
COPY register_bot.py .
COPY templates templates/

# 设置环境变量
ENV FLASK_APP=app.py
ENV FLASK_ENV=production
ENV PYTHONUNBUFFERED=1

# 暴露端口
EXPOSE 3000

# 使用 gunicorn 作为生产级 WSGI 服务器,添加错误日志
CMD ["gunicorn", "--bind", "0.0.0.0:3000", "--workers", "4", "--log-level", "debug", "--error-logfile", "-", "app:app"]