layerindex-web/docker
Paul Eggleton 08c979ac58 docker: Add docker-compose file
This makes deployment (and updates) much easier. You still need to
follow some setup instructions in the docker/README file, but the number
of steps is reduced and most commands simplified.

Thanks to Konrad Scherer <Konrad.Scherer@windriver.com> for suggesting
this (although the docker-compose.yml here was written from scratch).

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
2019-07-17 11:30:56 +12:00
..
.gitconfig docker: correct comment in .gitconfig 2018-08-29 21:42:02 +12:00
git-proxy Docker based environment setup 2015-10-07 11:34:34 +01:00
migrate.sh docker: migrate all applications, not just layerindex 2018-07-23 08:40:00 +02:00
nginx-ssl.conf docker: enhance example setup 2018-07-23 08:40:00 +02:00
nginx.conf Docker based environment setup 2015-10-07 11:34:34 +01:00
README docker: Add docker-compose file 2019-07-17 11:30:56 +12:00
refreshlayers.sh docker: enhance example setup 2018-07-23 08:40:00 +02:00
settings.py Enable password strength validation by default 2018-11-06 13:58:32 +13:00
updatelayers.sh docker: don't reload in updatelayers.sh 2018-07-23 08:40:00 +02:00

Layerindex example docker instructions

This is set up to make a cluster of 5 containers:

- layersapp: the application

- layersdb: the database

- layersweb: NGINX web server (as a proxy and for serving static content)

- layerscelery: Celery (for running background jobs)

- layersrabbit: RabbitMQ (required by Celery)

You will need docker and docker-compose installed in order to proceed.

First, find and replace layers.openembedded.org in the docker-compose.yml with your hostname

You'll probably also want to replace the database password "testingpw".

If you want to change any of the application configuration, edit docker/settings.py as desired.

Some settings have been set so that values can be passed in via environment variables, so you can set these from the docker-compose.yml if you want to.

You will definitely need to set SECRET_KEY and probably EMAIL_HOST.

If you are on a network that requires a proxy to get out to the internet, then you'll need to:

- Uncomment several lines in Dockerfile (search for "proxy")

- Edit docker/.gitconfig and docker/git-proxy

Start the containers:

docker-compose up

Apply any pending layerindex migrations / initialize the database

docker-compose run --rm layersapp /opt/migrate.sh

For a fresh database, create an admin account

docker-compose run --rm layersapp /opt/layerindex/manage.py createsuperuser

Set the volume permissions using debian:stretch since we recently fetched it

docker run --rm -v layerindexweb_layersmeta:/opt/workdir debian:stretch chown 500 /opt/workdir docker run --rm -v layerindexweb_layersstatic:/usr/share/nginx/html debian:stretch chown 500 /usr/share/nginx/html

Generate static assets. Run this command again to regenerate at any time (when static assets in the code are updated)

docker-compose run --rm -e STATIC_ROOT=/usr/share/nginx/html -v layerindexweb_layersstatic:/usr/share/nginx/html layersapp /opt/layerindex/manage.py collectstatic

Run the layer updates

docker-compose run --rm layersapp /opt/layerindex/layerindex/update.py

Or do a full refresh

docker-compose run --rm layersapp /opt/layerindex/layerindex/update.py -r

Once you've finished here, if this is a fresh database, you should now

follow the instructions in the "Database Setup" section of the main README.