Skip to content

Daniel-Fauland/streamlit-test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Streamlit App

Run locally

  • Install requirements:

    pip install -r requirements.txt
  • Start streamlit web-app locally by running the following command:

    streamlit run app.py
  • Note: This app uses "tesseract" for OCR. You need to install the executable as well as the python package in order to run it successfully.

  • Note: In order to convert a PDF to an image with "image2pdf" before sending it to tesseract you also need to install poppler which can not be installed with pip

Dockerize application

  • Build the docker image

    x86:

    docker build -t my-streamlit-app .

    Apple silicon:

    docker build --platform linux/amd64 -t my-streamlit-app .
  • Run the docker container (optional)

    docker run -p 8080:8080 my-streamlit-app

    Note: If you want to run the docker container locally on an Apple silicon Mac you should not specify the platform to built it natively for ARM to massively increase the performance of the application

Deploy to GCP using Cloud Run

For more detailed instructions check out this tutorial.

  • Tag the docker image

    docker tag my-streamlit-app europe-west3-docker.pkg.dev/propane-nomad-396712/cloud-run/my-streamlit-app
  • Push the tagged image to Artifact Registry

    docker push europe-west3-docker.pkg.dev/propane-nomad-396712/cloud-run/my-streamlit-app
  • Deploy the application using gcloud

    gcloud run deploy my-streamlit-app \
    --image europe-west3-docker.pkg.dev/propane-nomad-396712/cloud-run/my-streamlit-app \
    --platform managed \
    --allow-unauthenticated \
    --memory=8Gi \
    --cpu=4
  • You can retrieve the url at any time with this command

    gcloud run services describe my-streamlit-app --platform managed --region europe-west3 --format 'value(status.url)'

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published