| |
@@ -1,11 +1,59 @@
|
| |
- FROM fedoraqa/flask-base:24
|
| |
+ # This will produce an image to be used in Openshift
|
| |
+ # Build should be triggered from repo root like:
|
| |
+ # docker build -f openshift/Dockerfile \
|
| |
+ # --tag <IMAGE_TAG>
|
| |
|
| |
- RUN dnf install -y python-resultsdb_api && dnf clean all
|
| |
- COPY . /usr/src/resultsdb_frontend
|
| |
- COPY ./docker_data/settings.py /usr/src/resultsdb_frontend/conf/
|
| |
- WORKDIR /usr/src/resultsdb_frontend
|
| |
- EXPOSE 5002
|
| |
- ENV DEV true
|
| |
- RUN pip install -r requirements.txt
|
| |
+ FROM registry.fedoraproject.org/fedora:32
|
| |
+ LABEL \
|
| |
+ name="ResultsDB_frontend application" \
|
| |
+ vendor="ResultsDB_frontend developers" \
|
| |
+ license="GPLv2+" \
|
| |
+ description="ResultsDB_frontend is a simple application that allows browsing the data stored inside ResultsDB." \
|
| |
+ usage="" \
|
| |
+ build-date=""
|
| |
+
|
| |
+ USER root
|
| |
+ COPY ./resultsdb_frontend.spec /opt/app-root/src/resultsdb_frontend/resultsdb_frontend.spec
|
| |
+
|
| |
+ # install dependencies defined in RPM spec file
|
| |
+ RUN dnf -y install findutils rpm-build python3-pip python3-mod_wsgi httpd python3-psycopg2 python3-stomppy \
|
| |
+ && rpm --query --requires --specfile /opt/app-root/src/resultsdb_frontend/resultsdb_frontend.spec | xargs -d '\n' dnf -y install
|
| |
+
|
| |
+ COPY . /opt/app-root/src/resultsdb_frontend/
|
| |
+ # install using --no-deps option to ensure nothing comes from PyPi
|
| |
+ RUN pip3 install --no-deps /opt/app-root/src/resultsdb_frontend
|
| |
+
|
| |
+ # fix apache config for container use
|
| |
+ RUN sed -i 's#^WSGISocketPrefix .*#WSGISocketPrefix /tmp/wsgi#' /opt/app-root/src/resultsdb_frontend/conf/resultsdb_frontend.conf
|
| |
+
|
| |
+ # config files
|
| |
+ RUN install -d /usr/share/resultsdb_frontend/conf \
|
| |
+ && install -p -m 0644 /opt/app-root/src/resultsdb_frontend/conf/resultsdb_frontend.conf /usr/share/resultsdb_frontend/conf/ \
|
| |
+ && install -p -m 0644 /opt/app-root/src/resultsdb_frontend/conf/resultsdb_frontend.wsgi /usr/share/resultsdb_frontend/ \
|
| |
+ && install -d /etc/resultsdb_frontend \
|
| |
+ && install -p -m 0644 /opt/app-root/src/resultsdb_frontend/conf/resultsdb_frontend.conf /etc/httpd/conf.d/
|
| |
|
| |
- CMD ["python", "runapp.py"]
|
| |
+ RUN sudo touch /etc/resultsdb_frontend/settings.py
|
| |
+ RUN sudo echo "SECRET_KEY = '`cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 64 | head -n 1`'" >> /etc/resultsdb_frontend/settings.py
|
| |
+
|
| |
+ #RUN echo "RDB_URL = 'http://localhost:5001/api/v2.0'" >> /etc/resultsdb_frontend/settings.py #######################################
|
| |
+ RUN echo "RDB_URL = 'http://resultsdb:5001/api/v2.0'" >> /etc/resultsdb_frontend/settings.py #######################################
|
| |
+
|
| |
+
|
| |
+ # clean up
|
| |
+ RUN rm -rf /opt/app-root/src/resultsdb_frontend \
|
| |
+ && dnf -y autoremove findutils rpm-build \
|
| |
+ && dnf clean all
|
| |
+
|
| |
+ # EXPOSE 5002/tcp
|
| |
+ EXPOSE 5002
|
| |
+ CMD ["mod_wsgi-express-3", "start-server", "/usr/share/resultsdb_frontend/resultsdb_frontend.wsgi", \
|
| |
+ "--user", "apache", "--group", "apache", \
|
| |
+ "--port", "5002", "--threads", "5", \
|
| |
+ "--include-file", "/etc/httpd/conf.d/resultsdb_frontend.conf", \
|
| |
+ "--log-level", "info", \
|
| |
+ "--log-to-terminal", \
|
| |
+ "--access-log", \
|
| |
+ "--startup-log" \
|
| |
+ ]
|
| |
+ USER 1001:0
|
| |
JIRA: https://projects.engineering.redhat.com/browse/CWFHEALTH-530
Contribute a production ready Dockerfile for ResultsDB frontend.