The Dash Deployment CLI is a fully interactive command-line application built using the Textual framework. It guides users through the process of deploying a Python Dash app to an Ubuntu server. The app automates the deployment steps, making it easy for developers to deploy their Dash apps without manually running commands or configuring services.
- Step-by-Step Guidance: Walks users through the entire deployment process.
- Automated Commands: Runs shell commands automatically to set up the server, install dependencies, and configure services.
- User-Friendly Interface: Uses an interactive CLI interface with buttons, labels, and input prompts.
- Customizable: Easily modify the app to suit specific deployment needs.
- Supports:
- Python virtual environments.
- Dash and Gunicorn installation.
- Nginx configuration.
- Systemd service setup.
Before using the Dash Deployment CLI, ensure you have the following:
- Ubuntu Server: A running Ubuntu server (20.04 or later recommended).
- Python 3.8+: Installed on the server.
- SSH Access: Ability to connect to the server via SSH.
- Dash App Code: Your Dash app code ready for deployment.
-
Clone the Repository:
git clone https://github.com/studiozeroseven/dash_deploy.git cd dash_deploy -
Install Dependencies:
pip install -r requirements.txt
-
Run the CLI App:
python dash_deploy.py
-
Start the App: Run the app using the command:
python dash_deploy.py
-
Follow the Prompts:
- The app will guide you through each step of the deployment process.
- Provide inputs when prompted (e.g., app name).
- The app will automatically run commands and display output.
-
Deployment Steps: The app will perform the following steps:
- Update and install server dependencies.
- Set up a Python virtual environment.
- Install Dash and Gunicorn.
- Configure Nginx as a reverse proxy.
- Set up a systemd service to manage the Dash app.
-
Access Your Dash App: Once the deployment is complete, visit
http://your_server_ipin your browser to access your Dash app.
You can customize the app to suit your specific needs:
-
Nginx Configuration: Modify the Nginx configuration template in the
deploy_dash_appmethod to add SSL, custom domains, or other settings. -
Systemd Service: Adjust the systemd service configuration in the
deploy_dash_appmethod to change user permissions, working directories, or other parameters. -
Styling: Add custom CSS in the
style.cssfile to change the appearance of the CLI interface.
Here’s an example of how the app works:
-
Start the App:
python dash_deploy.py
-
Welcome Screen:
Welcome to the Dash App Deployment CLI! This tool will guide you through deploying your Dash app to an Ubuntu server. [Start Deployment] -
Enter App Name:
Enter a name for your Dash app (e.g., mydashapp): mydashapp -
Follow the Steps: The app will automatically:
- Update the server.
- Install dependencies.
- Set up a virtual environment.
- Install Dash and Gunicorn.
- Configure Nginx and systemd.
-
Deployment Complete:
Deployment Complete! Your Dash app is now deployed! Visit http://your_server_ip to access it.
-
Command Errors:
- If a command fails, the app will display the error message. Check the error and ensure all prerequisites are met.
-
Nginx Issues:
- If Nginx fails to restart, check the configuration file at
/etc/nginx/sites-available/your_app_name.
- If Nginx fails to restart, check the configuration file at
-
Systemd Service Issues:
- If the systemd service fails to start, check the logs using:
sudo journalctl -u your_app_name.service
- If the systemd service fails to start, check the logs using:
Contributions are welcome! If you’d like to contribute to this project, please follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Commit your changes.
- Submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
- Textual Framework: For providing an excellent Python CLI framework.
- Dash Framework: For making it easy to build web applications in Python.
- Codearmo Tutorial: For the detailed deployment guide.
For questions or feedback, please open an issue on GitHub or contact the maintainer:
- Ian Schwartz
- Email: ian@theapk.com
- GitHub: studiozeroseven
Enjoy deploying your Dash apps with ease! 🚀