Configuring System Dependencies

This documentation is for Dash Enterprise,
Plotly’s commercial platform for managing and improving
Dash applications in your organization.
View the docs or
request a trial.

In some cases you may need to install and configure system
dependencies. Examples include installing and configuring
database drivers or the Java JRE environment.
Dash Enterprise supports these actions through an
apt-packages file and a predeploy script.

 

We have a collection of sample apps that install common system-level
dependencies. These applications are ready to deploy:

 

If you need help configuring complex system level dependencies, please
reach out to our support team.


Install Apt Packages

In the root of your application folder, create a file called
apt-packages. Here you may specify apt packages to be
installed with one package per line. For example, to install
the ODBC driver we could include an apt-packages file that
looks like:

unixodbc
unixodbc-dev

Configure System Dependencies

You may include a pre-deploy script that executes in
your Dash App’s environment. For the case of adding an
ODBC driver, we need to add ODBC initialization files into
the correct systems paths. To do so, we include the ODBC
initialization files in the application folder and then
copy them into system paths in the pre-deploy script.

 

Add A Pre-Deploy Script

Let’s generate a file to do this. Note that the file can
have any name as we must specify the name in an application
configuration file app.json.
For the purposes of this example we assume we have
named it setup_pyodbc and installed it in the root of our
application folder.

cp /app/odbc.ini /etc/odbc.ini
cp /app/odbcinst.ini /etc/odbcinst.ini

 

Run Pre-Deploy Script Using app.json

Next we must instruct Dash Enterprise to run our setup_pyodbc
file by adding a JSON configuration file named app.json
into the root of our application folder.

{
    "scripts": {
        "dokku": {
            "predeploy": "/app/setup_pyodbc"
        }
    }
}

Now when the application is deployed, it will install the apt
packages specified in apt-packages and run the setup file
specified in app.json. In this case it allows us to install
and then configure the ODBC driver.

To see this example code in action
check out our ODBC example
On-Premises application.