Skip to content

Instantly share code, notes, and snippets.

@sorenisanerd
Last active May 24, 2021 03:43
Show Gist options
  • Save sorenisanerd/60587123e7bf9221d8719c11bc68cc23 to your computer and use it in GitHub Desktop.
Save sorenisanerd/60587123e7bf9221d8719c11bc68cc23 to your computer and use it in GitHub Desktop.
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"]
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)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment