TODO
(Optional) Create and activate venv
python -m venv venv
.\venv\Scripts\Activate.ps1Install necessary dependencies:
pip install -r src/requirements.txtNote: Cloud Run expects a single source directory for deployment from source. This directory should contain both a requirements.txt and the entry point to the app main.py.
TODO
To deploy from source (which automatically builds a container image from source code and deploys it) change to the directory src and use the following command:
gcloud run deploy --update-env-vars CLOUD_STORAGE_BUCKET=replace-with-storage-bucket-hereIf prompted to enable the API, reply y to enable.
-
When you are prompted for the source code location, press Enter to deploy the current folder (dir
src). -
When you are prompted for the service name, use e.g.
meme-random -
If you are prompted to enable the Artifact Registry API or to allow creation of Artifact Registry repository, respond by pressing
y. -
When you are prompted for region: select the region of your choice, e.g.
europe-west3 -
When you are prompted to allow unauthenticated invocations, respond by pressing
y.