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 ...
随机推荐
- turtle模块绘图
import turtle #运动命令 # forward(d) 向前移动d长度 # backward(d) 向后移动d长度 # right(d) 向右转动多少度 #left(d) 向左转动多少度 # ...
- HTML页面空格记录     (小计)
半角的不断行的空白格(推荐使用) 也就是咱们经常在英文状态下面使用的空格按键 半角的空格 他的宽度为中文字符的一半长度 全角的空格他的宽度为中文字符的长度
- [assembly: AssemblyVersion("1.0.1.*")] 指定版本字符串不符合所需格式 - major[.minor[.build[.revision]]]
报如下错误, 解决方法:打开项目文件,修改 打开项目文件修改:<Deterministic>true</Deterministic> 为:<Deterministic&g ...
- ubuntu安装postgresql以及pgadmin4当前最新(4.3)网页版
pgAdmin4安装 1.安装安装包 sudo apt-get install build-essential libssl-dev libffi-dev libgmp3-dev virtualenv ...
- 单点登录(SSO)详解
背景 在企业发展初期,企业使用的系统很少,通常一个或者两个,每个系统都有自己的登录模块,运营人员每天用自己的账号登录,很方便.但随着企业的发展,用到的系统随之增多,运营人员在操作不同的系统时,需要多次 ...
- MVC 纯Table实现树节点效果+授权
这几夜心里颇不平静, 奈何 JS水平有限,前台效果耗时四天,后台传值一天,直至昨夜丑时测试初步完成,其实就是一个给tree来授权,网上开源的插件很多,如treeview.treejs.easyui 等 ...
- 浅谈USB驱动架构 转载
去年,老师让我分析基于HD3系统芯片的WindowsCE USB驱动的可行性.USB驱动非常庞大,多个软件层次相互交错,以及各种协议,USB系统对于一般人很难理解,我对其也只是理解一个大概,下面,我对 ...
- git 使用过程中遇到的问题does not appear to be a git repository Could not read from remote respository
想把本地的git库上传到github上.github已经新建了一个public仓库,利用网站的命令 git Bash报错:does not appear to be a git repository ...
- Easy methods to select MB Star, Extremely MB Star, MB SD C4, Mercedes BENZ C5 SD
MB Star, Extremely MB SD Connect C4, MB SD C4, Mercedes BENZ C5 SD are usually analysis tools to get ...
- docker-images(镜像)
一.获取镜像 docker search NAME 搜索引擎查找镜像 docker pull NAME:<TAG> 拉去镜像 NAME:表示镜像名称/镜像仓库的名称 TAG: 表示镜像的 ...