Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Snippet for Deploying Containers to Cloud Run Tutorial
from flask import Flask, request
app = Flask(__name__)
@app.route("/", methods=["GET"])
def homepage():
if request.method == "GET":
return jsonify({"message": "Hello World!"})
PORT = int(os.environ.get("PORT", 8080))
if __name__ == '__main__':,host='',port=PORT)
# build & push the container image
- name: ""
args: ["--cache=true", "--cache-ttl=48h", ""]
# Deploy container image to Cloud Run
- name: ""
args: ['beta', 'run', 'deploy', 'myapp', '--image', '', '--region', 'us-central1', '--allow-unauthenticated', '--platform', 'managed']
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 [""]
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.