Skip to content

Example dashboard that uses a Docker file and DevContainer to allow the app to be accessed from the cloud

Notifications You must be signed in to change notification settings

murphyqm/example-dashboard-devcontainers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dash Dashboard

This repository contains a simple Dash dashboard application (from the Dash tutorial, "Dash in 20 Minutes"), configured to run locally using Docker and in GitHub Codespaces.

The point of this example:

  • To show how a set-up for local development and deployment (e.g. Docker) can also be used to create a free online virtual machine to run the app
  • To provide a possible solution/method of maintaining accessibility to the app beyond hosting it publicly
dash-dashboard
├── src
│   └── app.py            # Main application code for the Dash dashboard
├── .devcontainer
│   └── devcontainer.json # Configuration for the development container
├── Dockerfile            # Dockerfile to build the application image
├── requirements.txt      # Python dependencies required for the project
├── .gitignore            # Files and directories to ignore by Git
└── README.md             # Project documentation

Local development

In this example, we are mainly interested in the cloud-based option, but here are guidelines for local development too.

Prerequisites

  • Docker installed on your machine
  • Visual Studio Code with the Remote - Containers extension (for local development)

Running Locally with Docker

  1. Clone the repository:

    git clone git@github.com:murphyqm/example-dashboard-devcontainers.git
    cd dash-dashboard
    
  2. Build the Docker image:

    docker build -t dash-dashboard .
    
  3. Run the Docker container:

    docker run -p 8050:8050 dash-dashboard
    
  4. Open your web browser and navigate to http://localhost:8050 to view the dashboard.

Deploying in the cloud

Prerequisites

  • GitHub account (for using GitHub Codespaces)

Using GitHub Codespaces

  1. Open the repository in GitHub.

  2. Click on the green "Code" button and select "Open with Codespaces".

  3. A new Codespace will be created, and the environment will be set up automatically.

  4. Once the Codespace is ready, open a terminal and run:

    python src/app.py
    
  5. Access the dashboard through the provided URL in the Codespaces environment.

Dependencies

The project uses the following Python libraries:

  • Dash
  • Any other necessary libraries listed in requirements.txt

Disclaimer

This is a very quick/minimal example to show that a dashboard can be deployed from codespaces online; please ensure you read through the dev container and codespaces documentation in detail to ensure you tailor to your needs!

About

Example dashboard that uses a Docker file and DevContainer to allow the app to be accessed from the cloud

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published