[Python] ModuleNotFoundError on GCP Cloud Run

Discussão em 'Python' iniciado por Stack, Junho 9, 2025.

  1. Stack

    Stack Membro Participativo

    I'm deploying a fastapi app to GCP Cloud Run, and I get ModuleNotFoundError: No module named 'services.user.auth' .<module> ( /app-backend/app/routes/user/auth.py:11 )

    The docker container runs fine locally using compose, but GCP fails to locate modules.

    Dockerfile:

    FROM python:3.13.3-slim-bookworm

    RUN apt-get -y update
    RUN pip3 install --upgrade pip

    WORKDIR /app-backend

    RUN pip3 install uv

    RUN uv venv

    COPY requirements.txt requirements.txt

    RUN uv pip install --system -r requirements.txt

    COPY . .

    EXPOSE 8080:8080

    CMD ["python3", "main.py" ]

    Continue reading...

Compartilhe esta Página