mirror of
git://git.yoctoproject.org/layerindex-web.git
synced 2025-07-05 05:04:46 +02:00
![]() 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> |
||
---|---|---|
.. | ||
.gitconfig | ||
git-proxy | ||
migrate.sh | ||
nginx-ssl.conf | ||
nginx.conf | ||
README | ||
refreshlayers.sh | ||
settings.py | ||
updatelayers.sh |
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