Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

The user-provided container failed to start and listen on the port defined provided by the PORT=8000

Hi,

New to gCloud here so would welcome some guidance. I am having issue(s) deploy a LangServe app on Cloud Run. 

My app is a Langchain/Langserve app and runs fine locally. When I deploy it to gCloud, it seems to build the container fine but hangs at creating revision and eventually I get: 

"The user-provided container failed to start and listen on the port defined provided by the PORT=8000"

I also have message "Memory limit of 512 MiB exceeded with 517 MiB used" but when I increase to 1G I got similar message...

For the first TCP issue, looking at other threads, I saw people adding ENV HOSTNAME="0.0.0.0" \ to Dockerfile but when I do that, I get an error :"

Already have image (with digest): gcr.io/cloud-builders/docker" ??!!??
 
Any guidance would be welcome! Many thanks in advance
0 1 373
1 REPLY 1

As an updated, I have increase the memory of the revision to 2Gb and the memory error disappears. Still get the error above though.

For completeness, here's my docker file:

FROM python:3.11-slim

RUN pip install poetry==1.6.1

RUN poetry config virtualenvs.create false

WORKDIR /code

COPY ./pyproject.toml ./README.md ./poetry.lock* ./

COPY ./package[s] ./packages

RUN poetry install --no-interaction --no-ansi --no-root

COPY ./app ./app

RUN poetry install --no-interaction --no-ansi

EXPOSE 8080

CMD exec uvicorn app.server:app --host 0.0.0.0 --port 8080