[yocto] [layerindex-web] RFC: layer index docker fixes

Konrad Scherer Konrad.Scherer at windriver.com
Tue Oct 2 11:45:50 PDT 2018


On 09/05/2018 08:04 AM, Paul Eggleton wrote:
> On Thursday, 30 August 2018 11:44:10 AM NZST Paul Eggleton wrote:
>> On Wednesday, 29 August 2018 10:46:27 PM NZST Paul Eggleton wrote:
>>> I know Konrad promised to update the docker-compose setup to be closer
>>> to what we'd done recently with the docker setup, but I needed something
>>> urgently and wanted to learn how to use docker-compose anyway, so I've
>>> put this together:
>>>
>>>    http://git.yoctoproject.org/cgit/cgit.cgi/layerindex-web/log/?h=paule/docker-compose
>>>
>>> Let me know what you think - it works well enough for me here, although the
>>> setup commands are now a bit ugly on their own.
>>
>> I realised this morning that "docker-compose run" can simplify a lot of the
>> docker run commands, so I've just converted most of the commands in
>> docker/README and pushed the branch again.
> 
> So, any comments?

Sorry for the delay. I just rebased our internal layerindex to the 
latest and made some updates to the Dockerfiles and other files.

https://github.com/WindRiver-OpenSourceLabs/layerindex-web/tree/rebase-20181002

Dockerfile:
- added the wheel package to avoid errors in pip package installation
- Used ADD --chown to add all the files with the correct permissions to 
avoid a second chown RUN step
- Used an entrypoint.sh script instead of CMD to handle things like db 
initialization, creating a superuser, overriding default configuration 
with environment variables and collecting static files. The same 
entrypoint is used to start either the celery-worker or gunicorn.

https://github.com/WindRiver-OpenSourceLabs/layerindex-web/blob/rebase-20181002/docker/entrypoint.sh

docker/docker-compose.yaml:
- separating the gunicorn and the celery-worker is a good idea
- the blacklabelops/nginx image generates the nginx config from env 
variables which makes development easier. Changing an env var in 
docker-compose.yaml is easier than rebuilding the image or bind-mounting 
in a new version.
- One thing I didn't put in passing in the DB username and password 
because I am using this as a test instance, not a production one. Should 
be a simple change.

I had problems setting up a reverse proxy for the layerindex-web app 
when using a subpath (ie. http://<host>/li/). In urls.py, the leading 
slash on the last redirect works as a redirect to an absolute path and 
breaks the redirect when using a subpath . Fortunately the fix is simple 
and doesn't break usage without a subpath.

https://github.com/WindRiver-OpenSourceLabs/layerindex-web/commit/4586ff3f4fa477daa6e0bee6c6e9e0602105c8d2#diff-de6dd4b4c889fe0882cfd3f6df5aa451L29

Thanks!

-- 
Konrad Scherer, MTS, Linux Products Group, Wind River


More information about the yocto mailing list