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 ...
随机推荐
- spark MLlib实现的基于朴素贝叶斯(NaiveBayes)的中文文本自动分类
1.自动文本分类是对大量的非结构化的文字信息(文本文档.网页等)按照给定的分类体系,根据文字信息内容分到指定的类别中去,是一种有指导的学习过程. 分类过程采用基于统计的方法和向量空间模型可以对常见的文 ...
- StrictRedis
StrictRedis对象⽅法 通过init创建对象,指定参数host.port与指定的服务器和端⼝连接,host默认为localhost,port默认为6379,db默认为0 sr = Strict ...
- H.264学习--1
1.宏块(Macro Block):一个编码图像首先要划分成多个块(4x4 像素)才能进行处理,显然宏块应该是整数个块组成,通常宏块大小为 ...
- Objective-C RunTime 学习笔记 之 atomic/nonatomic 关键字
atomic修饰的是变量/方法,对于可变对象的指针变量是安全的,内部实现加了锁,但是对可变对象本身没什么影响,不安全还是不安全.另外atomic仅仅对编译器生产的getter.setter有效,如果自 ...
- vue知识总结
vue: 渐进式JavaScript 框架 Vue项目构建 npm install -g vue vue init webpack-simple my-project cd my-project np ...
- 最简单的 react-router4 的安装和使用
React-Router 的安装 npm install react-router React-Router提供了两个组件:Router和Route.下面看最简单的例子: src/Routes.js ...
- Java第一次实训课
//1.1 声明一个整型变量a,并赋初值5,在程序中判断a是奇数还是偶数,然后输出判断的结果. package mingye; public class Exc { public static voi ...
- Original Autel MaxiSys Pro MS908P support 2 Year Free Update Online
You can get 2 Year Free Update Online once you place an order on Autel MS908P. Software Version: Eve ...
- 对比剖析Swarm Kubernetes Marathon编排引擎
Docker Native Orchestration 基本结构 Docker Engine 1.12 集成了原生的编排引擎,用以替换了之前独立的Docker Swarm项目.Docker原生集群(S ...
- 对象序列化Serializable
一.Java对象的存储 首先我们先来理解一下Java对象在内存中的存储! JVM的内存分为三个部分:栈(stack).堆栈(heap).方法区(method area): 栈:主要存储基本数据类型变量 ...