部署阿里云

1、使用阿里云code镜像代码管理

(1)生成requirements.txt文件

pip freeze >requirements.txt

  

(2)创建python Dockerfile文件

# Use an official Python runtime as a parent image
FROM python:3.6

# Set the working directory to /app
WORKDIR /downloadreport

# Copy the current directory contents into the container at /app
ADD . /downloadreport

# Install any needed packages specified in requirements.txt
RUN pip install --trusted-host pypi.python.org -r requirements.txt

# Make port 80 available to the world outside this container
EXPOSE 4000

# Run app.py when the container launches
CMD ["python", "app.py"]

  

2、建立镜像仓库,并关联阿里云code

3、pull代码时自动构建镜像。

 

posted @ 2018-07-15 17:34  tutu_python  阅读(120)  评论(0)    收藏  举报