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
In this example, we are mainly interested in the cloud-based option, but here are guidelines for local development too.
- Docker installed on your machine
- Visual Studio Code with the Remote - Containers extension (for local development)
-
Clone the repository:
git clone git@github.com:murphyqm/example-dashboard-devcontainers.git cd dash-dashboard
-
Build the Docker image:
docker build -t dash-dashboard .
-
Run the Docker container:
docker run -p 8050:8050 dash-dashboard
-
Open your web browser and navigate to
http://localhost:8050
to view the dashboard.
- GitHub account (for using GitHub Codespaces)
-
Open the repository in GitHub.
-
Click on the green "Code" button and select "Open with Codespaces".
-
A new Codespace will be created, and the environment will be set up automatically.
-
Once the Codespace is ready, open a terminal and run:
python src/app.py
-
Access the dashboard through the provided URL in the Codespaces environment.
The project uses the following Python libraries:
- Dash
- Any other necessary libraries listed in
requirements.txt
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!