Update OpenShift Dockerfile
This is part of the work to create container images suitable for integration testing:
* Adjust Dockerfile to be in sync with the ones from WaiverDB and Greenwave.
* Add documentation on how to build and use the image, and the OpenShift template.
Build OpenShift container image on Fedora 28
--------------------------------------------
This will sync the container image to be used in OpenShift
deployements with WaiverDB and Greenwave.
mod_wsgi-express is provided by mod_wsgi in the Fedora repos
now, so remove installing it from PyPi and use dnf instead.
Allow resultsdb_rpm build arg to be a URL
--------------------------------------------
Remove USER directives
--------------------------------------------
Follow OpenShift guidelines [0], and adjust the group
ownership of the start-up script, instead of manipulating the
user ID.
[0]
<https://docs.openshift.org/latest/creating_images/guidelines.html#openshift-specific-guidelines>
Document usage of the OpenShift container image
--------------------------------------------
Add description and usage labels, and define expectations for
volume mounts.
Add pre-deployment hook
--------------------------------------------
Using pre-deployment hooks to initialise the database is
safer and the right way to go.
See: https://pagure.io/waiverdb/issue/121
In order handle timeouts due to the database service not being
available as the hook is executed, `resultsdb init_db`
is being re-triggered for up to 10 minutes, until succeeds.
Modify container entrypoint
--------------------------------------------
As the database initialisation is triggered as a
pre-deployement hook, there is no need for the run_app
script anymore.
This also tries to follow recommendations for
ENTRYPOINT and CMD usage, and use CMD as a way to define
default arguments for the ENTRYPOINT.
Signed-off-by: Hunor Csomortáni <csomh@redhat.com>
Merges #111