docker使用笔记
FROM hub.c..com/public/ubuntu:16.04-tools #源镜像
MAINTAINER adam.ding , dxf813@.com COPY requirements.txt /tmp/ #拷贝python需要安装文件
RUN apt-get update && apt-get -y install python3-pip libmysqlclient-dev python3-dev #python3-pip网易源没有
RUN echo "deb http://mirrors.163.com/ubuntu/ precise main restricted universe multiverse" > /etc/apt/sources.list
RUN apt-get update && apt-get install -y nginx redis-server git #下载一些基础服务
RUN mkdir /root/.pip #home目录
COPY pip.conf /root/.pip #拷贝更改的源配置文件
RUN pip3 install --upgrade pip
RUN pip3 install matplotlib #此处不能放入requirement 必须分别安装
RUN pip3 install numpy
COPY nginx-start.conf /etc/supervisor/conf.d #拷贝nginx配置文件
RUN pip3 install pandas==0.17.
RUN pip3 install zipline==1.0.
COPY uwsgi.ini /usr/local/etc/#拷贝uwsgi配置文件
RUN pip3 install uwsgi
COPY vue-dist /usr/local/src/dzh/#将打包好的vue项目文件夹拷贝到指定目录
RUN pip3 install --requirement /tmp/requirements.txt
RUN mkdir /usr/local/src/dzh
WORKDIR /usr/local/src/dzh #切换到目录
RUN git clone https://username:pad@xx.com/xx.git
WORKDIR /usr/local/src/dzh/squant_tools
RUN python3 setup.py build_ext --inplace#安装系统
WORKDIR /etc/nginx/sites-enabled/
RUN mv default default.bb #将默认读取配置文件改名
COPY nginx.conf .
WORKDIR /usr/local/src/dzh/simple_login
RUN python3 setup.py install
COPY squant_tools.conf /etc/supervisor/conf.d
CMD supervisord /etc/supervisor/supervisord.conf
3,部分其他文件的配置
uwsgi.ini内容:
[uwsgi]
http-socket = :
plugin = python3
wsgi-file = /usr/local/src/dzh/squant_tools/quant/wsgi.py
chdir= /usr/local/src/dzh/squant_tools
module = quant.wsgi
processes =
master=True
vacuum=True 使用supervisor启动以下进程
squant_tools.conf内容:
[program:squant_tools]
command = uwsgi /usr/local/etc/uwsgi.ini
stopsignal=KILL
autostart=true
autorestart=true
stdout_logfile=/usr/local/etc/supervisor_stdout.log
stderr_logfile=/usr/local/etc/supervisor_stderr.log
redirect_stderr=true nginx-start.conf内容:
[program:nginx]
command = service nginx start
process_name=%(program_name)s
numprocs= ; 启动几个进程
autostart=true ; 随着supervisord的启动而启动
autorestart=true ; 自动重启。。当然要选上了
startretries= ; 启动失败时的最多重试次数
stopsignal=KILL ; 用来杀死进程的信号
stopwaitsecs= ; 发送SIGKILL前的等待时间
redirect_stderr=true ; 重定向stderr到stdout requirements.txt内容:
django
mysqlclient
psycopg2
cython
pymssql
celery
django-cors-headers
click
cn-stock-holidays
redis
zipline_cn_databundle
docker使用笔记的更多相关文章
- Docker学习笔记 — 配置国内免费registry mirror
Docker学习笔记 — 配置国内免费registry mirror Docker学习笔记 — 配置国内免费registry mirror
- docker学习笔记1 -- 安装和配置
技术资料 docker中文官网:http://www.docker.org.cn/ 中文入门课程:http://www.docker.org.cn/book/docker.html docker学习笔 ...
- Docker学习笔记之一,搭建一个JAVA Tomcat运行环境
Docker学习笔记之一,搭建一个JAVA Tomcat运行环境 前言 Docker旨在提供一种应用程序的自动化部署解决方案,在 Linux 系统上迅速创建一个容器(轻量级虚拟机)并部署和运行应用程序 ...
- docker~学习笔记索引
回到占占推荐博客索引 使用docker也有段时间了,写了不少文章与总结,下面把它整理个目录出来,方便大家去学习与检索! docker~学习笔记索引 docker~linux下的部署和基本命令(2017 ...
- Docker学习笔记 - Docker容器内部署redis
Docker学习笔记(2-4)Docker应用实验-redist server 和client的安装使用 一.获取redis容器(含客户端和服务端) 二.创建服务端容器 1.在终端A中运行redis- ...
- docker学习笔记(一)—— ubuntu16.04下安装docker
docker学习笔记(一)—— ubuntu16.04下安装docker 原创 2018年03月01日 14:53:00 标签: docker / ubuntu 1682 本文开发环境为Ubuntu ...
- Docker入门笔记
Docker入门笔记 随笔记录初学Docker遇到的问题, 以免下次再犯. 本机系统Ubuntu18.04 安装 Docker有2个版本 Community Edition (CE) 社区版(免费) ...
- Docker入门笔记(1)
Docker入门笔记(1) 1.安装Docker yum -y install docker-ce 2.查看Docker版本 [root@localhost ~]# docker -v Docker ...
- Docker学习笔记总结
Docker学习笔记 https://yeasy.gitbooks.io/docker_practice/content/ 一 环境搭建 Ubuntu安装 .添加软件源的GPG密钥 curl -f ...
- docker学习笔记二:常用命令
docker学习笔记二:常用命令 查看docker常用命令 docker --help 返回结果如下: 其中常用的命令如下: 1.image相关操作 展示所有的image: 删除image: rmi ...
随机推荐
- FB面经prepare: Count the number of Vector
给一个超级大的排好序的vector [abbcccdddeeee]比如,要求返回[{,a}, {,b}, {,c}, {,d}, {,e}......]复杂度要优于O(N) 分析: 如果是binary ...
- Windows Java安装
jdk安装与配置jdk for windows1.下载官网地址:http://www.oracle.com/technetwork/java/javase/downloads/index.html2. ...
- vue生命周期钩子函数
<template> <div> <h2>this is from C.vue</h2> </div> </template> ...
- P3974 [TJOI2015]组合数学
题目描述 为了提高智商,ZJY开始学习组合数学.某一天她解决了这样一个问题:给一个网格图,其中某些格子有财宝.每次从左上角出发,只能往右或下走.问至少要走几次才可能把财宝全捡完. 但是她还不知足,想到 ...
- python学习笔记之socket(第七天)
参考文档: 1.金角大王博客:http://www.cnblogs.com/alex3714/articles/5227251.html ...
- Lua 函数参数 & 默认实参
[1]Lua函数,默认实参 习惯了其他语言(如C++)的默认实参,利用Lua语言的过程中,发现没有默认实参这种机制. 所以,自己模拟了一个满足业务需求的带默认实参的函数. (1)示例如下: local ...
- ubuntu上传到百度网盘
1 2 亲测可以上传
- Verify_Execute 验证SQL语句执行结果
#region Verify_Execute /// <summary> /// 验证insert.update.delete执行 /// </summary> /// < ...
- Mysql复制一个数据库到另一个数据库
mysqldump -u root -p source_db > /home/db_bak.sql #导出数据库 123456 #输入数据库密码 扩展: mysqldump -u root -p ...
- IP通信基础学习第三周(下)
TTL的最值是255. 数据部分不参与检验和的计算. 接收端的结果若为0,则保留:否则,会丢弃该数据报. IP数据报选项字段是可选的,主要用于网络测试和调试. IP辅助协议ICMP的消息类型有错误消息 ...