diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..737a599 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +FROM python:3.6 +RUN mkdir /project +ADD ./ /project +WORKDIR /project +RUN pip install -r requirements.txt -i https://pypi.mirrors.ustc.edu.cn/simple/ +CMD python service.py \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..447d03c --- /dev/null +++ b/requirements.txt @@ -0,0 +1,5 @@ +Flask==1.1.1 +Flask_SQLalchemy==2.4.1 +SQLalchemy==1.3.11 +Werkzeug==0.16.0 +uwsgi==2.0.18 \ No newline at end of file diff --git a/service.py b/service.py index ab2fdbb..ee588a3 100644 --- a/service.py +++ b/service.py @@ -111,6 +111,8 @@ def __init__(self, username, password): id = db.Column(db.Integer, primary_key=True) email = db.Column(db.String(50), nullable=False) password = db.Column(db.String(50), nullable=False) + +db.create_all() # ============================================================================================== # Tool class include some usual methods # ============================================================================================== @@ -688,7 +690,7 @@ def author(author_id): return render_template('author.html', articles=articles, comments=comments, Tool=Tool) if __name__ == '__main__': - app.run(debug=True) + app.run(host='0.0.0.0',port='8000',debug=True)