Sign inSign up

rylorin/streamlit-docker

By rylorin

Updated over 1 year ago

Run a Streamlit application from a GitHub repository

Image
Machine learning & AI
Data science
Web servers
0

1.1K

rylorin/streamlit-docker repository overview

streamlit-docker

GitHub Actions Workflow Status License MIT Docker Pulls

This repository contains a Docker container to run Streamlit applications from a GitHub repository or from a local volume.

📌 Prerequisites

Before getting started, make sure you have the following installed on your machine:

🚀 Installation & Usage

  1. Download the image

    docker pull rylorin/streamlit-docker
    
  2. Run the container

    docker run -p 8501:8501 rylorin/streamlit-docker
    
  3. Access the application

⚙️ Customization

The GIT_URL variable specifies the Git repository URL containing the Streamlit application to be executed. By default, it is set to https://github.com/streamlit/streamlit-example.git.

You can change it by specifying another URL:

export GIT_URL="https://github.com/your-user/your-repository.git"
docker run -p 8501:8501 --env GIT_URL="${GIT_URL}" rylorin/streamlit-docker

Or you can and mount your own script or volume to run a local application:

docker run -p 8501:8501 -v $(pwd)/my_app:/app/streamlit_app/ rylorin/streamlit-docker

🛠 Development & Debugging

  • To view real-time logs:
    docker logs -f <container_id>
    
  • To enter the container:
    docker exec -it <container_id> /bin/sh
    

📌 Deployment Example

🌍 Environment Variable GIT_URL

The GIT_URL variable specifies the Git repository URL containing the Streamlit application to be executed and can be set directly in docker-compose.yml:

environment:
  GIT_URL: https://github.com/your-user/your-repository.git

Example docker-compose.yml configuration to deploy the application with Docker Compose:

version: "3.8"
services:
  streamlit:
    image: rylorin/streamlit-docker:latest
    ports:
      - 8501:8501/tcp
    environment:
      GIT_URL: ${GIT_URL:-https://github.com/streamlit/streamlit-example.git}
    networks:
      - default
      - system_dmz_network

networks:
  default:
  system_dmz_network:
    external: true

📜 License

This project is licensed under the MIT License. See the LICENSE file for details.

✨ Contributions

Contributions are welcome! Please submit a pull request to rylorin/streamlit-docker GitHub repository with your improvements.

Tag summary

Content type

Image

Digest

sha256:d2efd48f3

Size

434.2 MB

Last updated

over 1 year ago

docker pull rylorin/streamlit-docker