diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..4be1ccc --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM python:3 +ENV DOCKER_APP True +WORKDIR /app + +RUN git clone https://git.wmi.amu.edu.pl/s415366/pbr-ayct-core +COPY . . +RUN chmod u+x setup_core.sh +RUN bash setup_core.sh +RUN pip3 install -r requirements.txt +EXPOSE 5000/udp +EXPOSE 5000/tcp +CMD ["python3", "app.py"] \ No newline at end of file diff --git a/app.py b/app.py index 9b9a039..848d3b9 100644 --- a/app.py +++ b/app.py @@ -1,14 +1,15 @@ from flask import Flask from flask_restful import Api, Resource +import pbrAyctCore.core as core app = Flask(__name__) api = Api(app) class Hello(Resource): def get(self): - return {"data": "All You Can Tweet"} + return core.getTestString() api.add_resource(Hello, "/hello") if __name__ == "__main__": - app.run(debug=True) \ No newline at end of file + app.run(debug=True) diff --git a/setup_core.sh b/setup_core.sh new file mode 100644 index 0000000..e3bb083 --- /dev/null +++ b/setup_core.sh @@ -0,0 +1,5 @@ +cd pbr-ayct-core +pip3 install setuptools +python3 -m pip install --upgrade build +python3 -m build +pip3 install dist/pbrAyctCore-0.0.1.tar.gz \ No newline at end of file