I think your question lacks some more technical context, but I think that maybe if your Dockerfile is just:

FROM python:3

RUN pip install requests

It actually should have the specification of the app files to be deployed.

FROM python:3

WORKDIR /app
COPY . /app
RUN pip install --no-cache-dir -r requirements.txt
RUN pip install requests # (If needed)
CMD ["python", "main.py"]

If that's the case I recommend searching on how to build a proper Dockerfile.

Hope it helps. :D

Answer from Ariel Carvalho on Stack Overflow
🌐
Google Cloud
cloud.google.com › cloud run › quickstart: deploy a python (flask) web app to google cloud with cloud run
Quickstart: Deploy a Python (Flask) web app to Google Cloud with Cloud Run | Google Cloud Documentation
By following the steps in this quickstart, Cloud Run automatically builds a Dockerfile for you when you deploy from source code. For more information on how the Python buildpack determines the default entrypoint for Cloud Run source deployments, see Build a Python application.
Discussions

How to automate a Python script with Docker and Google Cloud Run
This is awesome! For an even lower deployment/ops overhead, did you try hooking up a cloud scheduler function to a Gen 2 Cloud Function? Is there a reason you're using Cloud Run specifically? (CF Gen 2 runs on CR) More on reddit.com
🌐 r/googlecloud
3
5
December 15, 2022
docker - How to run a "hello world" python script with Google Cloud Run - Stack Overflow
Forgive my ignorance.. I'm trying to learn how to schedule python scripts with Google Cloud. After a bit of research, I've seen many people suggest Docker + Google Cloud Run + Cloud Scheduler. I've More on stackoverflow.com
🌐 stackoverflow.com
How to create a Google Cloud Job/Service/Run based on a Docker image - Stack Overflow
I have multiple Python pipelines that I want to run on the Google Platform as on-demand jobs. To simplify the process of installing dependencies and downloading/preparing ML models, I created a Doc... More on stackoverflow.com
🌐 stackoverflow.com
Python apps very slow on Google Cloud Run
I have deployed a python service on google cloud run and it is taking way more time than it does on my local docker container. I'm literally just installing pandas , pydantic and fastapi. Running the same api on a local docker container takes around 600-900ms but on cloud run the response time ... More on reddit.com
🌐 r/googlecloud
19
7
May 10, 2024
🌐
GitHub
github.com › jhanley-com › google-cloud-run-getting-started-python-flask › blob › master › Dockerfile
google-cloud-run-getting-started-python-flask/Dockerfile at master · jhanley-com/google-cloud-run-getting-started-python-flask
Repository for my article: Google Cloud Run - Getting Started with Python and Flask - google-cloud-run-getting-started-python-flask/Dockerfile at master · jhanley-com/google-cloud-run-getting-started-python-flask
Author   jhanley-com
🌐
Medium
medium.com › google-cloud › cloud-run-job-with-a-python-module-f072f49b9849
Cloud Run job Python Google Cloud | Google Cloud - Community
September 10, 2024 - The build-cloud-run-job-docker-image.yaml file allows to build and publish the Docker image to Artifact Registry (repo in GCP) steps: - name: 'gcr.io/cloud-builders/docker' script: | docker build -f team_league/job/Dockerfile -t $JOB_NAME .
🌐
GitHub
github.com › GoogleCloudPlatform › cloud-run-microservice-template-python › blob › main › Dockerfile
cloud-run-microservice-template-python/Dockerfile at main · GoogleCloudPlatform/cloud-run-microservice-template-python
FROM python:3.13.5-slim · · # Allow statements and log messages to immediately appear in the Cloud Run logs · ENV PYTHONUNBUFFERED 1 · · # Create and change to the app directory. WORKDIR /usr/src/app · · # Copy application dependency manifests to the container image.
Author   GoogleCloudPlatform
🌐
GitHub
github.com › GoogleCloudPlatform › cloud-run-helloworld-python › blob › main › Dockerfile
cloud-run-helloworld-python/Dockerfile at main · GoogleCloudPlatform/cloud-run-helloworld-python
ENV PYTHONUNBUFFERED True · · # Copy local code to the container image. ENV APP_HOME /app · WORKDIR $APP_HOME · COPY . ./ · # Install production dependencies. RUN pip install Flask gunicorn · · # Run the web service on container startup. Here we use the gunicorn ·
Author   GoogleCloudPlatform
🌐
Medium
001-dharmendra.medium.com › getting-started-with-google-cloud-run-deploying-python-scripts-609838f82a8b
Getting Started with Google Cloud Run: Deploying Python Scripts | by dharmendra mishra | Medium
October 16, 2023 - This Dockerfile uses an official Python 3.9 image, sets up the working directory, copies the Python script and requirements file, installs dependencies, exposes port 8080, and runs the Python script.
Find elsewhere
🌐
YouTube
youtube.com › watch
Deploy Python Code to Google Cloud Run using Docker: Step-by-Step Guide for Beginners - YouTube
In this video, we'll walk you through deploying a Python application to Google Cloud Run using Docker. We'll cover:1. Setting up your Python project2. Creati...
Published   February 22, 2025
🌐
Reddit
reddit.com › r/googlecloud › how to automate a python script with docker and google cloud run
r/googlecloud on Reddit: How to automate a Python script with Docker and Google Cloud Run
December 15, 2022 -

Link

I recently took on the challenge of automating a Python script, on a schedule with Docker and Google Cloud. While it sounds simple, this was quite tricky for me (a data scientist - not an engineer). I documented my steps in the referenced post for others who may find this useful.

Various posts in this sub helped me get this accomplished. (Particularly this).

Note that Google Cloud Run Services are different than Google Cloud Run Jobs. Services require your app to listen for HTTP requests. Jobs don't. This subtle distinction tripped me up, and I don't think it's talked about enough.

🌐
GitHub
github.com › GoogleCloudPlatform › python-runtime
GitHub - GoogleCloudPlatform/python-runtime: gcr.io/google_appengine/python - Docker images for python
This repository contains the source for the gcr.io/google-appengine/python docker base image. This image can be used as the base image for running applications on Google App Engine Flexible, Google Kubernetes Engine, or any other Docker host.
Starred by 221 users
Forked by 115 users
Languages   Python 70.1% | Shell 29.7% | Dockerfile 0.2% | Python 70.1% | Shell 29.7% | Dockerfile 0.2%
🌐
Google
codelabs.developers.google.com › codelabs › cloud-run-hello-python3
Hello Cloud Run with Python | Google Codelabs
March 20, 2026 - Under the hood, to deploy your application, Cloud Run pairs with the container ecosystem: Cloud Build automatically builds a container image from your source code and pushes it to Artifact Registry. Artifact Registry manages your container image. Now, you're ready to start working and write your application... In this step, you'll build a simple Flask-based Python application responding to HTTP requests.
🌐
Towards Data Science
towardsdatascience.com › home › latest › deploying containers with docker, gcp cloud run and flask-restful
Deploying Containers with Docker, GCP Cloud Run and Flask-RESTful | Towards Data Science
January 30, 2025 - Then from the following options select ‘Cloud Run Application‘ → ‘Python (Flask) : Cloud Run‘. This gives you the sample Flask-based ‘Hello World’ application for Cloud Run that we will build on to access our BigQuery dataset. You should now have something like this: ... The next steps will be changing the provided app.py and Dockerfile, as well as adding some code of our own to access BigQuery.
🌐
Google Cloud
cloud.google.com › application hosting › cloud run › quickstart: build and create a python job in cloud run
Quickstart: build and create a Python job in Cloud Run | Google Cloud
Learn how to create a simple Cloud Run job, then deploy from source, which automatically packages your code into a container image, uploads the container image to Artifact Registry, and then deploys to Cloud Run.
🌐
Google
docs.cloud.google.com › cloud run › optimize python applications for cloud run
Optimize Python applications for Cloud Run | Google Cloud Documentation
You can add specific packages back in by adding a RUN apt install line to your Dockerfile. For more information, see Using system packages in Cloud Run. There are also options for non-Debian based containers. The python:alpine option might result in a much smaller container, but many Python ...
🌐
Medium
medium.com › @judydev › deploy-a-fastapi-docker-container-on-google-cloud-run-via-github-137d030d70a4
Deploy a FastAPI Docker Container on Google Cloud Run (via GitHub)
October 2, 2025 - If you want to keep all the Python files at the root level, make sure to update the Dockerfile below accordingly. ... This file includes all the Python packages used in the project. fastapi[standard]==0.115.5 uvicorn==0.32.1 pydantic==2.10.2 google-cloud-firestore==2.19.0 uuid==1.30 ... FROM python:3.9 COPY requirements.txt . RUN pip install --no-cache-dir --upgrade -r requirements.txt ENV APP_HOME=/root WORKDIR $APP_HOME COPY /src $APP_HOME/src # remove this line in PROD environment COPY ./serviceAccountKey.json /serviceAccountKey.json CMD ["uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "80"]
🌐
Crawlee
crawlee.dev › deployment › cloud run
Cloud Run | Crawlee for Python · Fast, reliable Python web crawlers.
3 weeks ago - All you have to do now is run gcloud run deploy in your project folder (the one with your Dockerfile in it). The gcloud CLI application will ask you a few questions, such as what region you want to deploy your application in, or whether you ...
🌐
Stack Overflow
stackoverflow.com › questions › 78180949 › how-to-create-a-google-cloud-job-service-run-based-on-a-docker-image
How to create a Google Cloud Job/Service/Run based on a Docker image - Stack Overflow
I have multiple Python pipelines that I want to run on the Google Platform as on-demand jobs. To simplify the process of installing dependencies and downloading/preparing ML models, I created a Docker image containing all the necessary requirements. The entrypoint of the image is set to my main.py file, which takes unique arguments for each run.
🌐
Practiceprobs
practiceprobs.com › blog › 2022 › 12 › 15 › how-to-schedule-a-python-script-with-docker-and-google-cloud
How to schedule a Python script with Docker and Google Cloud - Practice Probs
December 15, 2022 - Learn how to use Docker to containerize a Python script. Push the image to Google Cloud Artifact Registry. Deploy it with Google Cloud Run. Schedule the job to run daily with Google Cloud Scheduler.
🌐
GitHub
github.com › GoogleCloudPlatform › cloud-run-microservice-template-python
GitHub - GoogleCloudPlatform/cloud-run-microservice-template-python
Dockerfile: Container build instructions, if needed to replace buildpack for custom build · SIGTERM handler: Catch termination signal for cleanup before Cloud Run stops the container · Service metadata: Access service metadata, project ID and region, at runtime
Starred by 107 users
Forked by 74 users
Languages   Python 78.7% | Shell 12.1% | Dockerfile 8.8% | Procfile 0.4% | Python 78.7% | Shell 12.1% | Dockerfile 8.8% | Procfile 0.4%