added dockerfile #1
12
Dockerfile
Normal file
12
Dockerfile
Normal file
@ -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"]
|
7
app.py
7
app.py
@ -1,14 +1,17 @@
|
|||||||
from flask import Flask
|
from flask import Flask
|
||||||
from flask_restful import Api, Resource
|
from flask_restful import Api, Resource
|
||||||
|
import os
|
||||||
|
import pbrAyctCore.core as core
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
api = Api(app)
|
api = Api(app)
|
||||||
|
|
||||||
class Hello(Resource):
|
class Hello(Resource):
|
||||||
def get(self):
|
def get(self):
|
||||||
return {"data": "All You Can Tweet"}
|
return core.getTestString()
|
||||||
|
|
||||||
api.add_resource(Hello, "/hello")
|
api.add_resource(Hello, "/hello")
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
app.run(debug=True)
|
port = int(os.environ.get('PORT', 5000))
|
||||||
|
app.run(host = '0.0.0.0', port = port)
|
||||||
|
3
heroku.yml
Normal file
3
heroku.yml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
build:
|
||||||
|
docker:
|
||||||
|
web: Dockerfile
|
5
setup_core.sh
Normal file
5
setup_core.sh
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user