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.
🌐
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.
🌐
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
🌐
Google
codelabs.developers.google.com › codelabs › cloud-run-hello-python3
Hello Cloud Run with Python | Google Codelabs
March 20, 2026 - In this tutorial, you’ll learn how to get started with Cloud Run by deploying and running a stateless container serverless-ly (with the infrastructure abstracted away). Cloud Run offers a fully-managed option as well as the ability to run on top of a GKE cluster.
🌐
Google Cloud
cloud.google.com › cloud run › quickstarts
Quickstarts | Cloud Run | Google Cloud Documentation
Create a simple Cloud Run job in Python, package it into a container image, and deploy to Cloud Run.
Find elsewhere
🌐
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.
🌐
Ovexro
blog.ovexro.com › home › education & e-learning › deploy your python fastapi app with docker and google cloud
Deploy Your Python FastAPI App with Docker and Google Cloud – OVEX TECH
This guide will show you how to take your Python FastAPI application and deploy it using Docker and Google Cloud Run. You’ll learn how to package your app into a container, set up a cloud-based database, and get your application running on ...
Published   6 days ago
🌐
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 .
🌐
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.
🌐
GitHub
github.com › GoogleCloudPlatform › python-runtime
GitHub - GoogleCloudPlatform/python-runtime: gcr.io/google_appengine/python - Docker images for python
For other docker hosts, you'll need to create a Dockerfile based on this image that copies your application code, installs dependencies, and declares an command or entrypoint. For example: FROM gcr.io/google-appengine/python # Create a virtualenv for dependencies. This isolates these packages from # system-level packages. # Use -p python3 or -p python3.7 to select python version. Default is version 2. RUN virtualenv /env # Setting these environment variables are the same as running # source /env/bin/activate.
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%
🌐
Modal
modal.com › blog › run-docker-image
The easiest way to run a Docker image in the cloud
February 24, 2025 - Modal is a Python library that lets you run code in containers in the cloud - and it’s the easiest way to run a Docker image in the cloud. Modal allows you to specify custom images for those containers, including images from public registries like Docker Hub as well as private images from AWS ECR and GCP Artifact Registry. In this guide, we’ll cover how you can run both public and private images, as well as images defined in a Dockerfile, on Modal, in less than five minutes.
🌐
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 › 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 · Local development utilities: Auto-restart with changes and prettify logs · Structured logging w/ Log Correlation JSON formatted logger, parsable by Cloud Logging, with automatic correlation of container logs to a request log.
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%
🌐
Medium
medium.com › @jankrynauw › running-a-python-script-using-docker-pycharm-google-cloud-platform-2bc7ba999916
Running a python script using Docker, Pycharm & Google Cloud Platform | by Jan Krynauw | Medium
July 29, 2021 - If not install here — you need to login / create a docker account to download. On a Mac, you’ll see this small Docker icon in your top toolbar · Within your codebase create a Dockerfile file with ...