Added Gunicorn Docker server (fixed #7)

This commit is contained in:
FrederikBaerentsen 2024-06-18 17:40:32 +02:00
parent 45026c37dd
commit 13d2f8a895
2 changed files with 5 additions and 2 deletions

View File

@ -3,4 +3,6 @@ WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
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
View File

@ -11,6 +11,7 @@ import re #regex
import rebrick #rebrickable api
import requests # request img from web
import shutil # save img locally
import eventlet
app = Flask(__name__)
socketio = SocketIO(app)
@ -763,4 +764,4 @@ def save_number(tmp):
return Response(status=204)
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))