Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,59 @@ Currently supported options are:
USES_OAUTH - whether or not data is protected using OAuth
ALLOWED_EMAILS - the filename containing the list of allowed emails when using OAuth
PUBLIC_DIR - path to directory of public data when using OAuth (eg. /static/data/public)

### Deployment
Flask is not meant to be a standalone/permanent hosting solution.
If you are intending to deploy this as an intranet service (Think carefully before exposing genomic data to an unprotected network) you may find it conveinent to route Flask through a proper web server such as Apache or Nginx. For this, Flask requires an intermediate layer which understands python such as Gunicorn or uWSGI. Gunicorn is native to python detects most settings automatically, but needs an accompanying daemon to keep it running in the background. uWSGI has native packages on most common distros, but requires a configuration such as the following.

for debian-based distros, the following are dependencies:
```
uwsgi-emperor uwsgi-plugin-python3
```

This configuration assumes that this repository is cloned to
/srv/igvjs/igvjs
and the virtualenv is created at
/srv/igvjs/virtualenvironment

```
virtualenv /srv/igvjs/virtualenvironment
source /srv/igvjs/virtualenv/bin/activate
pip3 install -r /srv/igvjs/igvjs/requirements.txt
```

/etc/uwsgi-emperor/vassals/igv.ini
```
[uwsgi]
plugins = python3
project = igvjs
uid = igv
gid = www-data
base = /srv/igvjs

chdir = %(base)/%(project)
home = %(base)/virtualenv
module = igvjs:app

master = true
processes = 5

socket = /run/uwsgi/%(project).sock
mount = /igv=%(module)
vacuum = true

; rewrite SCRIPT_NAME and PATH_INFO accordingly
manage-script-name = true
```

In this setup, an appropriate nginx directive would be

```
location /igv {
uwsgi_pass unix:///run/uwsgi/igvjs.sock;
include uwsgi_params;
}
location ^~ /static/ {
alias /srv/igvjs/igvjs/igvjs/static;
}
```