Files
Nexusphp-Panel/Dockerfile
DengDai ad2c65affb init
2025-12-08 14:31:21 +08:00

25 lines
546 B
Docker
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 使用官方 Python 运行时作为基础镜像
FROM python:3.9-slim
# 设置工作目录
WORKDIR /app
# 复制 requirements.txt 文件到工作目录
COPY requirements.txt .
# 安装项目依赖
RUN pip install --no-cache-dir -r requirements.txt
# 复制项目代码到工作目录
COPY . .
# 创建非 root 用户
RUN useradd --create-home --shell /bin/bash app && \
chown -R app:app /app
USER app
# 暴露端口
EXPOSE 5000
# 使用 Flask 内置服务器运行应用(生产环境建议使用 Gunicorn
CMD ["python", "app.py"]