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: (gcloud.run.deploy) 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.
I’m in a similar boat. App is deployed and running, but I don’t have a web app to handle authentication so the only way to get at the page is:
Allow unauthenticated access
Send a request with a custom header somehow
Unauthenticated access is a non-starter because of the data I’m displaying, and I don’t know of a way to send a custom header request somewhere that I can actually display the webpage when it loads. It would also be too cumbersome for non-developers to use.
The last line of the Docker file is
CMD streamlit run --server.port 8080 --server.enableCORS false interface.py
where interface.py is the python script which holds the logic. In your case, you need to change “interface.py” to your script file.py name.
Requirements should include all the libraries that your script will need. In addition, you will need
streamlit
streamlit-aggrid
in case you are using the AgGrid for displaying the output of a dataframe.
Docker file can copy any file that you include in the list . Here is an example, paste the below lines in your docker to copy all of the files.
Copy the rest of the working directory contents into the container at /app
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.