first commit
This commit is contained in:
commit
59bc1ecf45
|
@ -0,0 +1,3 @@
|
||||||
|
/.idea
|
||||||
|
/venv
|
||||||
|
*.pyc
|
|
@ -0,0 +1,14 @@
|
||||||
|
stages:
|
||||||
|
- deploy
|
||||||
|
|
||||||
|
job:
|
||||||
|
stage: deploy
|
||||||
|
script:
|
||||||
|
- docker stop tfse_admin
|
||||||
|
- docker rm tfse_admin
|
||||||
|
- docker build -t tfse_admin .
|
||||||
|
- docker run -d -p 51013:51013 --name tfse_admin -v /etc/timezone:/etc/timezone:ro -v /etc/localtime:/etc/localtime:ro tfse_admin
|
||||||
|
only:
|
||||||
|
- master
|
||||||
|
tags:
|
||||||
|
- tfse_admin
|
|
@ -0,0 +1,6 @@
|
||||||
|
FROM python:3.8
|
||||||
|
WORKDIR /usr/src/app/tfse_admin
|
||||||
|
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"]
|
|
@ -0,0 +1,10 @@
|
||||||
|
from flask import Flask
|
||||||
|
from flask_cors import *
|
||||||
|
|
||||||
|
app = Flask(__name__)
|
||||||
|
CORS(app, supports_credentials=True)
|
||||||
|
app.config['JSON_SORT_KEYS'] = False
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
app.run()
|
|
@ -0,0 +1,8 @@
|
||||||
|
from setting import APP_PORT
|
||||||
|
|
||||||
|
# 并行工作进程数
|
||||||
|
workers = 10
|
||||||
|
# 监听内网端口
|
||||||
|
bind = '0.0.0.0:{}'.format(APP_PORT)
|
||||||
|
# 工作模式协程
|
||||||
|
worker_class = 'gevent'
|
|
@ -0,0 +1,10 @@
|
||||||
|
flask~=1.1.2
|
||||||
|
flask_cors
|
||||||
|
gunicorn
|
||||||
|
gevent
|
||||||
|
Werkzeug~=1.0.1
|
||||||
|
itsdangerous~=1.1.0
|
||||||
|
pymongo~=3.11.0
|
||||||
|
requests~=2.25.1
|
||||||
|
rsa~=4.7.2
|
||||||
|
pycryptodome
|
|
@ -0,0 +1,3 @@
|
||||||
|
# 应用配置
|
||||||
|
APP_NAME = 'tfse_admin'
|
||||||
|
APP_PORT = '51013'
|
|
@ -0,0 +1,10 @@
|
||||||
|
|
||||||
|
|
||||||
|
class User:
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
self.uid = None
|
||||||
|
self.name = None
|
||||||
|
self.role = None
|
||||||
|
self.menus = None
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"UID": null,
|
||||||
|
"name": null,
|
||||||
|
"role": null,
|
||||||
|
"menus": null
|
||||||
|
}
|
Loading…
Reference in New Issue