Homec4science

docker: Dockerfile and compose config rewrite

Authored by Marco Neumann <marco@crepererum.net> on Apr 10 2015, 11:31.

Description

docker: Dockerfile and compose config rewrite

  • Sets correct redis connection in compose file. The required config flags for the worker and for the web part are different. Therefore these changes are only required for the worker node.
  • Makes Bower executable as root when setting up developer config. This is legit because the config script must only be used in isolated developer setups and therefore this change does not affect security of production setup.
  • Syncs the Dockerfile with the methods we're using for Travis.
  • Adds helper script docker_devboot that synchronizes Invenio initialization. That is required because worker and web container must share the same initialized Invenio data. This script also fixes some problems with bower because it is not able to install assets to a absolute path.
  • Installs up-to-date pip and mock from PyPI as well as all required packages for Invenio. The requirement level is configurable (same as travis).
  • Installs Bower, Less, clean-css and UglifyJS and RequireJS. They are used for asset building.
  • Installs missing MySQL client. This is required to run the inveniomanage database commands.
  • Installs sudo, because it is required for tests.
  • Orders the building commands carefully so that the base image can be cached by Docker.
  • Adds more file types to dockerignore to produce cleaner images and prevent docker from rebuilding when temporary or (editor) backup files change. It seems that there is no global .dockerignore which can be used by developers to add all their personal temporary files (like ~/.gitignore).
  • Adds another docker compose config with directory sharing between containers and code sharing between containers and host. We might want to merge them later using the new extends keyword, in case it is stable enough.
  • Adds watchdog package to dev requirements. This is required to enable live reloading of the application when running with shared code between container and host machine. Info: Live-reloading of template files does not seem to work. As a workaround you might touch one of the python files in the invenio package.
  • Uses special user account for Invenio instead of root and forbids write-access to code or bin directories. This acccount is forced to have UID=1000.
  • Uses the solution for #2862 to enable docker to pass all test. Changes docs to reflect this.
  • Adds documentation about docker requirements, usage of docker compose, live reloading, documentation building and testing using the docker containers.
  • Adds a lot of documentation on how to build overlay images using the invenio base image.
  • Adds explaining chart on how the docker developer setup works. This might be very helpful for further users and maintainers.
  • Adds information on how to debug Invenio when running as docker instance.

Signed-off-by: Marco Neumann <marco@crepererum.net>

Details

Committed
Marco Neumann <marco@crepererum.net>Apr 21 2015, 13:33
Parents
R3600:d5d40d1bb7ec: travis: extraction of dev config into script
Branches
Unknown
Tags
Unknown

Event Timeline

Marco Neumann <marco@crepererum.net> committed R3600:ab72121a2534: docker: Dockerfile and compose config rewrite (authored by Marco Neumann <marco@crepererum.net>).Apr 21 2015, 13:33