File size: 538 Bytes
b006049
 
02386d4
b006049
 
02386d4
 
b006049
f556c19
 
 
b006049
3cbbbf4
02386d4
 
 
 
 
f556c19
 
02386d4
 
b006049
 
3cbbbf4
 
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
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 .

# 设置环境变量
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", "app:app"]