Skip to content

Commit

Permalink
Remove incorrect documentation around setup
Browse files Browse the repository at this point in the history
For some reason, when @AlirezaRa94 added the docker instructions, he left the old virtualenv instructions in place[1]. They are now incorrect, since we use `emission` modules in the codebase now.

https://github.com/e-mission/op-admin-dashboard/blob/6f0c381a2e54d2c46c8b5335fbb64413beb8927d/utils/db_utils.py#L10

[1] For some reason, people don't like to delete code or instructions so we start having an accretion of obsolete cruft...
  • Loading branch information
shankari authored Aug 20, 2023
1 parent 6f0c381 commit 43f740b
Showing 1 changed file with 8 additions and 60 deletions.
68 changes: 8 additions & 60 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,78 +3,26 @@

https://towardsdatascience.com/dockerize-your-dash-app-1e155dd1cea3


Basic Dash app with data load, global variable module, and various UI examples.

### NREL Branding
This app uses the NREL Branding component, which is included as a .tgz and is installed via pip (see below).


## How to run this app

(The following instructions apply to Windows command line.)

Create and activate a new virtual environment (recommended) by running
the following:

On Windows

```
virtualenv venv
\venv\scripts\activate
```
On Mac
```
virtualenv venv
source venv/bin/activate
```

Or if using linux

```bash
python3 -m venv myvenv
source myvenv/bin/activate
```

Install the requirements:

```
pip install -r dashboard/requirements.txt
```

Run the app:

```
python app.py
```
You can run the app on your browser at http://127.0.0.1:8050



## Resources

To learn more about Dash, please visit [documentation](https://plot.ly/dash).


## Docker

`docker build -t dash-app .`

`docker run dash-app`

## Docker Compose (recommended)
## How to run it: Docker Compose (recommended)

`docker compose -f docker-compose-dash-app.yml build`

`docker compose -f docker-compose-dash-app.yml up`

You **must** use this method. Do **not** try to directly by setting up a virtualenv with the `requirements.txt`
This uses components of the e-mission-server core, so it must have the e-mission-server modules in the PYTHONPATH
The easiest method to accomplish this is to use the docker container, which is built on top of the e-mission-server base docker container.

## Test with a reverse proxy

```
docker-compose -f docker-compose-prod-nginx.yml build
docker-compose -f docker-compose-prod-nginx.yml up -d
```

The dash component assumes that it is running from the host root, and will barf if you try to run it behind a reverse proxy with a different file prefix.
This setting tests that configuration using an embedded reverse proxy in the docker container.

# Dynamic Config

## Set Variables
Expand Down

0 comments on commit 43f740b

Please sign in to comment.