Deployment fails on Cloud Run


I’m using Google Cloud Run to deploy a Streamlit application.
Cloud Build fails to deploy even though Docker is running successfully in local env.

I looked at the build log and found the following message.

ERROR: ( Cloud Run error: Container failed to start. Failed to start and then listen on the port defined by the PORT environment variable. Logs for this revision might contain more information.

I tried to do my own trial and error, but I couldn’t solve the problem.
If you know of a solution or an example repository please help me.

The current code for my application is shown below.

# .streamlit/config.toml
serverAddress = ""

enableCORS = false
headless = true
# Dockerfile
FROM python:3.8 as builder


COPY . .

RUN pip install poetry
RUN poetry install --no-dev

CMD ["make", "run"]
# Makefile
PORT ?= 8080

	poetry run streamlit run --server.port ${PORT}
import streamlit as st

def main():

if __name__ == "__main__":


I solved thid issue myself.
I always thought it was a Streamlit or Docker issue, but Poetry was the cause of the error.

Added RUN poetry config virtualenvs.create false && poetry install --no-dev

1 Like

Glad you found out :slight_smile: and thanks for sharing the solution !