update 上传部署代码

This commit is contained in:
彭森 2021-12-01 14:36:30 +08:00
parent 821f81fd60
commit 6bb8642028
5 changed files with 34 additions and 1 deletions

14
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,14 @@
stages:
- deploy
job:
stage: deploy
script:
# - docker stop service_tyc
# - docker rm service_tyc
- docker build -t service_tyc .
- docker run -d -p 51011:51011 --name service_tyc -v /etc/timezone:/etc/timezone:ro -v /etc/localtime:/etc/localtime:ro service_tyc
only:
- master
tags:
- service_tyc

6
Dockerfile Normal file
View File

@ -0,0 +1,6 @@
FROM python:3.8
WORKDIR /usr/src/app/service_tyc
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt -i https://pypi.mirrors.ustc.edu.cn/simple
COPY . .
CMD ["gunicorn", "app:app", "-c", "./gunicorn.conf.py"]

8
gunicorn.conf.py Normal file
View File

@ -0,0 +1,8 @@
from setting import APP_PORT
# 并行工作进程数
workers = 10
# 监听内网端口
bind = '0.0.0.0:{}'.format(APP_PORT)
# 工作模式协程
worker_class = 'gevent'

5
requirements.txt Normal file
View File

@ -0,0 +1,5 @@
flask~=1.1.2
flask_cors
gunicorn
gevent
pymongo~=3.11.3

View File

@ -1,5 +1,5 @@
PROJECT_NAME = 'tfse_tyc'
PROJECT_PORT = '60006'
APP_PORT = '51011'
# 数据库配置(tyc)
DB_HOST = '116.63.130.34'