Commit 0d69bf8f authored by 杨成林's avatar 杨成林

Merge branch 'feature_docker' into 'master'

Feature docker

See merge request alpha/sun!316
parents be60d3fd 5a281bfc
FROM python:3.6
ENV PATH="/usr/local/bin:$PATH"
COPY . /srv/apps/sun/
WORKDIR /root/.ssh/
ADD ssh/id_rsa .
ADD ./sources.list /etc/apt/sources.list
WORKDIR /srv/apps/sun/
RUN chmod -R 600 /root/.ssh/id_rsa \
&& echo "StrictHostKeyChecking no" >> /etc/ssh/ssh_config \
&& mkdir -p /data/log/sun/app
RUN apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 3B4FE6ACC0B21F32 \
&& apt-get -y update && apt-get -y install mysql-client libmysqlclient-dev \
&& apt-get clean \
&& apt-get autoclean \
&& rm -rf /var/lib/apt/lists/*
RUN pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt
ENTRYPOINT bash -c 'source ~/.bashrc && gunicorn sun.wsgi:application -w 4 -b 0.0.0.0:8090 -k gevent'
...@@ -35,3 +35,15 @@ ...@@ -35,3 +35,15 @@
说明: 说明:
sun采用前后端分离,前端请求打到后端,然后通过rpc去venus请求数据。 sun采用前后端分离,前端请求打到后端,然后通过rpc去venus请求数据。
在启动项目之前,记得配置好路由表和启动venus项目。 在启动项目之前,记得配置好路由表和启动venus项目。
###############################################################
镜像构建命令
docker build . -t sun-test:1.0
容器启动命令
docker run -it -p 8990:8000 -d \
--volume=/etc/gm-config:/etc/gm-config \
--volume=/etc/resolv.conf:/etc/resolv.conf \
--volume=/srv/apps/sun/sun/settings_local.py:/srv/apps/sun/sun/settings_local.py \
--entrypoint="/bin/bash" sun-test:1.0 "-c" "source ~/.bashrc && gunicorn sun.wsgi:application -w 4 -b 0.0.0.0:8090 -k gevent"
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
-----BEGIN RSA PRIVATE KEY-----
MIIEowIBAAKCAQEAvnSXGsqnlSxWVh9e4U40lWeV1f8DOD4B/atSjfxU9CJaSisc
xtmcLcyRY91lwx2OJJ0GvTx0DBifYBRsvpu8zrG33QQgr+StuJlIKUMlCXzaqsVt
u4wWgSLRks1nKFXVL4yIsKDxUAc60abHB3x9ygM+pS182iZAaW7yowe/E05IvnkU
jLifQRgQ2jLpgOmlxI+X2BDw988exIlwqfdErmEe06DMjuCbLnhbOUhD+Q88Xtn6
7UfxN4IiQTkRai405ZEhr5QKnqmx4RQF5Am+00p8caDksOQQYYQ0sKt+52rUnwfS
p7TQw6A+1QCZtaz3Sdbvhmace2mlC/Ekl2ZVCQIDAQABAoIBACEFkAl6J7JKnLGU
ANxptd5NtoIDFCjVP30fDlJF9OjbZ/JCJVwo8NZUCMVa5sD8x997RmbbK3fJcSC0
ieJGmGbyE2IDzDMTIDfIg+V7mdlaR4OidZM2B9TeF54vdPpeX3c+E5kkXpK0njMp
ioq2wAydoWf8ShB832Aod3Ni7XNIK6QtAQEWwJTPSbXLXx6+X8JIRoVFpZmNLkOA
MG1ElGPRH5fm92D/ZYfBMkDqPUFQF28f96MazD8EFDGRyOU/rpi4pIa+fZJYlIm1
ICzpk8UvSgg3xEWRhSvzoCixdxdVToX4JCZ8jSO6IlqDwa22WmB3rhjCVP3Ctbog
kStqizECgYEA8KRXxt78XVDKcW6Ydv2wmeN2JSQxxKgypU6Ux6amF8WY+0OThCdL
JDfva+ada04UVNdJ/dz3NDBr238e03pF8Z/gZp1NV3/m5rCARXrLIfxxCAVOae0P
nQVnBF270knUWM0vO6E+EhAzKlOcrTZXNQYdtGFic9IydNd1wXx98m0CgYEAypxK
JRny68YtKzwtaFlrgCkaJqGqExLglabskubFuh0g0878bLM4Ogpd514Z46ZUzUcv
859SQzGR48XGd7lUEZvQeAnCfalyl5dc/FDIiz/P2jiwjPvMGR6XVwWllJTWZwTc
H9TQ6ls3xigU9FO3ts0bEBqTVoGGl8xYWPHdq40CgYBbWDbNkaVAEsPVzQJo4KGh
uJsHPDb8DFC1OR/2rUaM7X/FmQAtAPFf/S+PyMlmiwvirJo0mCTqFZtLhXSBF//m
2SZILVvHZBCU7tiyBwuGihmpzsHWKZtsojlZie8awtWtI63TN8ClAKs7XOOzSFZQ
FVM/Plwt1NM8UPEtEgGI/QKBgQCT5w1VEiE7rfpRIme/Ue9gqiB17PO7Yr9hX245
Oo9CcnsBQ4sPSrET5XdxK0dY4JXtGDdP75DcjjYCgOCFi1tsU0MWLYG1u9l0AcGW
St5qkFWJ5nIzKKhv+d3eX7fkw9XTdD/AWNl9CsOnOqE5TlfA8O79jXja4EjBTSF9
JGp+DQKBgC04JCqYJ4jHTQLNCEh42tajL34K8VCltNWdHrAabnd9a16YqzsdVIZ/
xxOBghO9Xwhz666v8yh5TDGAR8XA9kCNbVxeDlqWP1oqWMpHXSwUN5Q7cH/l8M8F
YlQLOkFz4B9mSobZoiupYXS9mpe2kMase2FroYkTy6NFX8mKa93q
-----END RSA PRIVATE KEY-----
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment