一、打包在线安装
1.导出依赖包名:
pip freeze > requirements.txt
2.在线安装依赖包:
pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/
3.导出包离线安装
pip download -d r:\require -r r:\requirments.txt
4.离线安装依赖包
pip install --no-index --find-links=r:\require -r r:\require/requestments.txt
python+java docker环境的dockerFile
FROM python:3.7
WORKDIR /
ADD jy-centralized-control.jar jy-centralized-control.jar
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo 'Asia/Shanghai' >/etc/timezone
ADD python /home/ariczeng/yqdz/python
ADD jdk1.8.0_301 /opt/jdk8
ENV JAVA_HOME /opt/jdk8
ENV PATH $JAVA_HOME/bin:$PATH
ADD requirements.txt requirements.txt
RUN pip install -r requirements.txt -i https://mirrors.aliyun.com/pypi/simple/
EXPOSE 8881
CMD java -Dfile.encoding=utf-8 -jar jy-centralized-control.jar