Is it possible to deploy streamlit app with google cloudrun + API gateaway?

Hello, I am trying to deploy a streamlit app with google cloudrun + API gateaway. I successfully deployed a dockerised version to cloudrun and now, I am trying to point to cloudrun app using API gateaway endpoint (cloudrun app is not publicly accessible). Based on google’s documentation, I have created the following spec file (see below).

I see some articles, which are just based on google cloud run (here but I see nothing with API-gateaway.

After deploying this I just get white screen of death and the error I see

Failed to load resource: the server responded with a status of 404 ()

I am not sure if streamlit can be deployed this way. I don’t have enough web dev experience to comment on it. We have been using this approach to deploy some simple flask based front-ends in the firm. Any help would be appreciated.

swagger: "2.0"
info:
  title: app
  description: App
  version: 1.0.0
schemes:
  - https
produces:
  - text/html
paths:
  /:
    get:
      summary: app
      operationId: search
      x-google-backend:
        address: https://cloud-run.app
      responses:
        "200":
          description: OK
  /static/js/{file}:
    get:
      parameters:
        - name: file
          in: path
          required: true
          type: string
          default: "0"
      summary: get webpage
      operationId: get_javascript
      description: get javascript
      responses:
        200:
          description: OK
  /static/css/{file}:
    get:
      parameters:
        - name: file
          in: path
          required: true
          type: string
          default: "0"
      summary: get webpage
      operationId: get_css
      description: get css
      responses:
        200:
          description: OK

Debug info

  • Streamlit version: latest
  • Python version: 3.10
  • Using Conda: No
  • OS version: ubuntu
  • Browser version: chrome latest

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.