Last active
August 12, 2024 16:13
-
-
Save nbcchen/1891a4602dd03579d4a629a3da0e3476 to your computer and use it in GitHub Desktop.
Flask
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 flask import Flask, render_template | |
import os | |
app = Flask(__name__) | |
@app.route('/') | |
def home(): | |
return render_template('index.html') | |
if __name__ == "__main__": | |
port = int(os.environ.get('PORT', 5000)) | |
app.run(debug=True, host='0.0.0.0', port=port) |
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.8-alpine | |
COPY ./requirements.txt /app/requirements.txt | |
WORKDIR /app | |
RUN pip install -r requirements.txt | |
# copy every content from the local file to the image | |
COPY . /app | |
# configure the container to run in an executed manner | |
ENTRYPOINT [ "python" ] | |
CMD ["app.py"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment