heroku deploy with gunicorn

This commit is contained in:
Łukasz Jędyk 2022-06-09 19:52:54 +02:00
parent 8adf41ed35
commit aab31f21aa
3 changed files with 9 additions and 7 deletions

View File

@ -9,4 +9,4 @@ COPY . .
RUN pip3 install -r requirements.txt RUN pip3 install -r requirements.txt
EXPOSE 5000/udp EXPOSE 5000/udp
EXPOSE 5000/tcp EXPOSE 5000/tcp
CMD ["python3","-m", "ayct_backend.app"] CMD ["gunicorn", "-b", "0.0.0.0:5000", "ayct_backend:app", "--timeout", "120"]

View File

@ -1,7 +1,7 @@
import os # import os
from . import create_app # from . import create_app
if __name__ == "__main__": # if __name__ == "__main__":
app = create_app() # app = create_app()
port = int(os.environ.get('PORT', 5000)) # port = int(os.environ.get('PORT', 5000))
app.run(host = '0.0.0.0', port = port) # app.run(host = '0.0.0.0', port = port)

View File

@ -5,3 +5,5 @@ requests_oauthlib==1.3.0
psycopg2==2.9.3 psycopg2==2.9.3
pytest==6.2.5 pytest==6.2.5
google-api-python-client==2.36.0 google-api-python-client==2.36.0
nltk==3.7
gunicorn==20.1.0