Skip to content

Instantly share code, notes, and snippets.



Last active Mar 20, 2020
What would you like to do?
Hello World - A Containerized Flask Web Application
# builds & pushes the container image to GCR
- name: ''
# deploy image to cloud run
- name: ""
args: ['beta', 'run', 'deploy', 'webapp', '--image', '$PROJECT_ID/webapp:latest', '--region', 'us-central1', '--platform', 'managed', '--allow-unauthenticated']
FROM python:3.7-stretch
RUN apt-get update -y
RUN apt-get install -y python-pip python-dev build-essential
COPY . /app
RUN pip install -r requirements.txt
ENTRYPOINT ["python"]
CMD [""]
<h1> Hello World from Flask Web App </h1>
import os
from flask import Flask, request
app = Flask(__name__, static_url_path='', static_folder='')
def root():
return app.send_static_file('index.html')
PORT = int(os.environ.get("PORT", 8080))
if __name__ == '__main__':,host='',port=PORT)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.