1 Star 0 Fork 0

山海/ConMan

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
dockerfile 690 Bytes
一键复制 编辑 原始数据 按行查看 历史
孜然 提交于 2023-11-05 09:41 +08:00 . V0.1:优化dockerfile
# 使用官方Python镜像作为基础镜像
FROM python:3.8-slim-buster
# 配置时区和安装所需的包
RUN ln -snf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo Asia/Shanghai > /etc/timezone
# 设置工作目录
WORKDIR /app
# 将当前目录内容复制到工作目录中
COPY . /app
RUN pip3 install --no-cache-dir -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt && \
rm -rf /root/.cache/pip && \
adduser conman
# 将工作目录的所有权更改为非root用户
RUN chown -R conman:conman /app/
# 切换到非root用户
USER conman
# 暴露端口5000供应用使用
EXPOSE 5000
# 在容器启动时运行Python应用
CMD ["python3", "./app.py"]
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/yunwe/con-man.git
git@gitee.com:yunwe/con-man.git
yunwe
con-man
ConMan
master

搜索帮助