Spaces:
1v1
/
Running

gp2 / Dockerfile
1v1's picture
Update Dockerfile
9224dc1 verified
raw
history blame contribute delete
635 Bytes
# 使用 Python 3.10 作为基础镜像
FROM python:3.10-slim
# 设置工作目录
WORKDIR /app
# 安装系统依赖
RUN apt-get update && apt-get install -y \
libgl1-mesa-glx \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# 复制项目文件
COPY . /app/
RUN mkdir -p /app/logs
RUN chmod -R 777 /app
# 安装 Python 依赖
RUN pip install --no-cache-dir -r requirements.txt
# 设置环境变量
ENV PYTHONPATH=/app
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo 'Asia/Shanghai' >/etc/timezone
# 暴露端口(如果需要)
EXPOSE 8888
# 启动命令
CMD ["python", "web_server.py"]