Last active
May 24, 2021 03:43
-
-
Save sorenisanerd/60587123e7bf9221d8719c11bc68cc23 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM python:3.9 | |
WORKDIR /app | |
COPY requirements.txt . | |
RUN pip install -r requirements.txt | |
COPY . . | |
ENTRYPOINT ["python", "-m", "gunicorn", "--bind", ":8080", "--workers", "1", "--threads", "8", "--timeout", "0", "main:app"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
from flask import Flask, request | |
app = Flask(__name__) | |
@app.route('/') | |
def index(): | |
return ("$HOME is %s." % os.environ.get("HOME"), 200) | |
if __name__ == "__main__": | |
app.run(debug=False, host='0.0.0.0', port=int(os.environ.get('PORT', 8080))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Flask | |
gunicorn |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment