mirror of
https://git.oceanpay.cc/danial/kami_ctrip.git
synced 2025-12-18 21:50:51 +00:00
- 新增 .drone.yml 文件,配置 Drone CI/CD 流程 - 添加 Dockerfile,定义应用的 Docker 镜像构建过程 - 新增 app.py 文件,实现携程卡绑定功能 - 添加 __pycache__ 目录,存放编译后的 Python 文件
37 lines
1.2 KiB
Docker
37 lines
1.2 KiB
Docker
# 基于 Python 3.8.6 镜像
|
|
FROM python:3.8.6
|
|
|
|
WORKDIR /app
|
|
|
|
# 设置工作目录
|
|
ENV FLASK_APP=app.py
|
|
# 复制项目
|
|
ADD . /app
|
|
|
|
# 修改apt-get源地址为阿里云镜像
|
|
RUN echo "" > /etc/apt/sources.list && \
|
|
echo "deb http://mirrors.aliyun.com/debian buster main" >> /etc/apt/sources.list && \
|
|
echo "deb http://mirrors.aliyun.com/debian-security buster/updates main" >> /etc/apt/sources.list && \
|
|
echo "deb http://mirrors.aliyun.com/debian buster-updates main" >> /etc/apt/sources.list
|
|
|
|
# 安装cv2依赖和其他依赖
|
|
RUN apt-get update && apt-get install -y libgl1-mesa-glx libglib2.0-0
|
|
|
|
# 下载并安装 Node.js
|
|
RUN wget https://nodejs.org/dist/v16.13.0/node-v16.13.0-linux-x64.tar.gz && \
|
|
tar -xvf node-v16.13.0-linux-x64.tar.gz && \
|
|
mv node-v16.13.0-linux-x64 /usr/local/nodejs && \
|
|
ln -s /usr/local/nodejs/bin/node /usr/local/bin && \
|
|
ln -s /usr/local/nodejs/bin/npm /usr/local/bin && \
|
|
rm node-v16.13.0-linux-x64.tar.gz
|
|
|
|
# python环境包
|
|
RUN pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple gunicorn gevent
|
|
RUN pip3 install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple/
|
|
|
|
# 暴露容器端口
|
|
EXPOSE 5001
|
|
|
|
# 运行应用
|
|
CMD ["gunicorn", "-c", "gun.conf", "app:app"]
|