Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
5 changes: 5 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -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
4 changes: 3 additions & 1 deletion service.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
# ==============================================================================================
Expand Down Expand Up @@ -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)



Expand Down