layerindex-web/docker
Paul Eggleton bf94b2f7e9 update.py: allow updating all branches with one command
Allow updating multiple branches, and if no branches are specified,
update all branches that have a new "updates_enabled" flag field set to
True. This avoids the need to have a separate shell script which runs
update.py for each branch (and thus has hardcoded knowledge of each
active branch in the index, i.e. it needs to be kept up-to-date in
addition to the database.)

The migration will default updates_enabled to True for all branches so
if you wish to take advantage of this functionality, the flag will need
to be set to False for any branches that shouldn't be updated.

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2016-06-10 06:55:26 +12:00
..
.gitconfig Docker based environment setup 2015-10-07 11:34:34 +01:00
git-proxy Docker based environment setup 2015-10-07 11:34:34 +01:00
migrate.sh Docker based environment setup 2015-10-07 11:34:34 +01:00
nginx.conf Docker based environment setup 2015-10-07 11:34:34 +01:00
README Docker based environment setup 2015-10-07 11:34:34 +01:00
updatelayers.sh update.py: allow updating all branches with one command 2016-06-10 06:55:26 +12:00

This is set up to make a cluster of three containers. First we build two from the root of the repo.

docker build -t halstead/layerindex-app . docker build -t halstead/layerindex-web -f Dockerfile.web .

Start a database server. We use MariaDB in production.

In order to configure your settings.py file to use this database server, use:

'ENGINE': 'django.db.backends.mysql',

'NAME': 'layersdb',

'USER': 'root',

'PASSWORD': 'testingpw',

'HOST': 'layersdb',

'PORT': '',

docker run -d --name layerdb -e MYSQL_ROOT_PASSWORD=testingpw -e MYSQL_DATABASE=layersdb mariadb

If you have a copy of the the production data now is the time to insert it.

If not you can skip the next step for a clean install.

xzcat ./layerdb.sql.xz | docker run -i --link layerdb:layersdb --rm mariadb sh -c 'exec mysql -hlayersdb -uroot -p"testingpw" layersdb'

docker run -d --link layerdb:layersdb --name layersapp halstead/layerindex-app docker run -d --link layersapp:layersapp --name layersweb -p 49153:80 halstead/layerindex-web

To apply layerindex migration

docker run --rm --link layerdb:layersdb halstead/layerindex-app /opt/migrate.sh

To update the layer info we can run the job in a temporary container.

docker run --rm --link layerdb:layersdb halstead/layerindex-app /opt/updatelayers.sh