Added Gunicorn Docker server (fixed #7)
This commit is contained in:
parent
45026c37dd
commit
13d2f8a895
@ -3,4 +3,6 @@ WORKDIR /app
|
|||||||
COPY requirements.txt .
|
COPY requirements.txt .
|
||||||
RUN pip install -r requirements.txt
|
RUN pip install -r requirements.txt
|
||||||
COPY . .
|
COPY . .
|
||||||
CMD ["python", "app.py"]
|
RUN bash lego.sh
|
||||||
|
#CMD ["python", "app.py"]
|
||||||
|
CMD ["gunicorn","--bind","0.0.0.0:3333","app:app","--worker-class","eventlet"]
|
||||||
|
3
app.py
3
app.py
@ -11,6 +11,7 @@ import re #regex
|
|||||||
import rebrick #rebrickable api
|
import rebrick #rebrickable api
|
||||||
import requests # request img from web
|
import requests # request img from web
|
||||||
import shutil # save img locally
|
import shutil # save img locally
|
||||||
|
import eventlet
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
socketio = SocketIO(app)
|
socketio = SocketIO(app)
|
||||||
@ -763,4 +764,4 @@ def save_number(tmp):
|
|||||||
return Response(status=204)
|
return Response(status=204)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
socketio.run(app.run(host='0.0.0.0', debug=True, port=3333))
|
socketio.run(app.run(host='0.0.0.0', debug=False, port=3333))
|
||||||
|
Loading…
Reference in New Issue
Block a user