BETTERZON-49: Added minimal Flask API as Docker container

This commit is contained in:
henningxtro 2021-04-07 23:28:31 +02:00
parent 91a59de073
commit d4f7c7940d
4 changed files with 26 additions and 1 deletions

View File

@ -1,8 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4"> <module type="WEB_MODULE" version="4">
<component name="FacetManager">
<facet type="Python" name="Python">
<configuration sdkName="Python 3.9 (venv)" />
</facet>
</component>
<component name="NewModuleRootManager" inherit-compiler-output="true"> <component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output /> <exclude-output />
<content url="file://$MODULE_DIR$" /> <content url="file://$MODULE_DIR$" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="Python 3.9 (venv) interpreter library" level="application" />
</component> </component>
</module> </module>

View File

@ -17,4 +17,4 @@ EXPOSE 22026
# Start API # Start API
RUN echo 'Starting API' RUN echo 'Starting API'
CMD ["python3", "main.py"] CMD ["python3", "api.py"]

16
Crawler/api.py Normal file
View File

@ -0,0 +1,16 @@
from flask import Flask
from flask_restful import Resource, Api
app = Flask(__name__)
api = Api(app)
class CrawlerApi(Resource):
def get(self):
return {'Hallo': 'Betterzon'}
api.add_resource(CrawlerApi, '/')
if __name__ == '__main__':
app.run(host='0.0.0.0', port=22026)

View File

@ -1 +1,4 @@
pymysql pymysql
flask
flask-sqlalchemy
flask_restful