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-shell的Scala的一些方法详解
Tom,DataBase,80 Tom,Algorithm,50 Tom,DataStructure,60 Jim,DataBase,90 Jim,Algorithm,60 Jim,DataStruc ...
- 光圈,快门, 曝光,焦距, ISO,景深。
光圈,快门, 曝光,焦距, ISO,景深. ISO(感光度)与图片质量 ISO -- 感光度,是一个曝光率极高的词,我们在超市买饼干的时候就可能会看见包装袋上写:本公司已通过ISO9001质量体系认证 ...
- redis maxheap 51200000
Redis无法启动 今天在启动Redis时提示以下错: C:\Java\redis2817>redis-server.exe redis.windows.conf [5268] 23 Apr 1 ...
- postergresql允许其它主机远程连接
1.pg_hba.conf中添加listen_addresses = '*' #vim /usr/local/postgresql/data/pg_hba.conf #listen_addresses ...
- html-webpack-plugin 遇到 throw new Error('Cyclic dependency' + nodeRep)
今天遇到了 html-webpack-plugin 遇到 throw new Error('Cyclic dependency' + nodeRep) 错. 刚查到一篇文章,<手摸手,带你用合理 ...
- CodeForces - 1102A
You are given an integer sequence 1,2,-,n1,2,-,n. You have to divide it into two sets AA and BB in s ...
- LeetCode Weekly Contest 118
要死要死,第一题竟然错误8次,心态崩了呀,自己没有考虑清楚,STL用的也不是很熟,一直犯错. 第二题也是在室友的帮助下完成的,心态崩了. 970. Powerful Integers Given tw ...
- Flutter中使用sqlite
sqflite使用引入插件在pubspec.yaml文件中添加path_provider插件,2019年2月18号最新版本为1.1.0: dependencies: flutter: sdk: flu ...
- SSH 安全加固
检查密码重用是否受限制 | 身份鉴别 说明:强制用户不重用最近使用的密码,降低密码猜测攻击风险 描述:设置较低的Max AuthTrimes参数将降低SSH服务器被暴力攻击成功的风险. 加固建议:在/ ...
- 如何在xlwt中编写多个列的单元格?
目的,写下面的表格: ---------------- | Long Cell | ---------------- | 1 | 2 | ---------------- 如果下面这样写: sheet ...