first commit

This commit is contained in:
王思川 2021-12-31 14:51:41 +08:00
commit 59bc1ecf45
14 changed files with 70 additions and 0 deletions

3
.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
/.idea
/venv
*.pyc

14
.gitlab-ci.yml.bak Normal file
View File

@ -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

6
Dockerfile Normal file
View File

@ -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"]

10
app.py Normal file
View File

@ -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
common/__init__.py Normal file
View File

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'

10
requirements.txt Normal file
View File

@ -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

3
setting.py Normal file
View File

@ -0,0 +1,3 @@
# 应用配置
APP_NAME = 'tfse_admin'
APP_PORT = '51013'

10
user/User.py Normal file
View File

@ -0,0 +1,10 @@
class User:
def __init__(self):
self.uid = None
self.name = None
self.role = None
self.menus = None

0
user/__init__.py Normal file
View File

0
user/db.py Normal file
View File

0
user/routes.py Normal file
View File

0
user/scripts.py Normal file
View File

View File

@ -0,0 +1,6 @@
{
"UID": null,
"name": null,
"role": null,
"menus": null
}