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