项目结构:
比如,在pycharm里需要运行 themain.py
1、上传Linux的目录结构:
Dockerfile 文件需要制作:
这里是关键:
#基于的基础镜像
FROM python:3.12.0
#代码添加到code文件夹
ADD ./EF_NFCS /code
#设置code文件夹是工作目录
WORKDIR /code
#安装支持
RUN pip3 install -r requirements.txt
CMD ["python3", "/code/themain.py"]
其中,这条命令的意思就是,使用python3环境,启动 themain.py
CMD ["python3", "/code/themai