diff --git a/roles/openshift-apps/fasjson/templates/Dockerfile b/roles/openshift-apps/fasjson/templates/Dockerfile index 99f1fa25f1..c5f6aa859e 100644 --- a/roles/openshift-apps/fasjson/templates/Dockerfile +++ b/roles/openshift-apps/fasjson/templates/Dockerfile @@ -3,13 +3,11 @@ LABEL \ name="fasjson" \ vendor="Fedora Infrastructure" \ license="GPLv3+" -ENV HOME=/tmp +ENV HOME=/opt RUN dnf install -y \ openldap-clients \ vim \ git \ - python3-pip \ - python3-setuptools \ ipa-client \ gcc \ python-devel \ @@ -20,21 +18,17 @@ RUN dnf install -y \ mod_session \ policycoreutils-python-utils \ python3-mod_wsgi \ - python3-dns \ - python3-flask \ - python3-gssapi \ - python3-requests-gssapi \ - python3-ldap \ - python3-pip \ - python3-wheel && \ + python3-pip && \ dnf autoremove -y && \ dnf clean all -y +RUN python3 -m venv /opt/venv +RUN /opt/venv/bin/pip install poetry RUN git clone https://github.com/fedora-infra/fasjson.git && \ pushd fasjson && \ git checkout {{ (env == 'production')|ternary('stable', 'staging') }} && \ - pip-3 install . && \ + /opt/venv/bin/poetry config virtualenvs.create false && \ + /opt/venv/bin/poetry install --no-dev && \ popd && \ - rm -rf fasjson RUN rm -f /etc/krb5.conf && ln -sf /etc/krb5/krb5.conf /etc/krb5.conf && \ rm -f /etc/openldap/ldap.conf && ln -sf /etc/ipa/ldap.conf /etc/openldap/ldap.conf EXPOSE 8080 diff --git a/roles/openshift-apps/fasjson/templates/httpd.conf b/roles/openshift-apps/fasjson/templates/httpd.conf index 6792c022bf..4120edc791 100644 --- a/roles/openshift-apps/fasjson/templates/httpd.conf +++ b/roles/openshift-apps/fasjson/templates/httpd.conf @@ -47,6 +47,7 @@ ErrorLog /httpdir/error.log LogLevel info WSGISocketPrefix run/wsgi +WSGIPythonHome /opt/venv WSGIDaemonProcess fasjson processes=4 threads=1 maximum-requests=500 \ display-name=%{GROUP} socket-timeout=2147483647 \ lang=C.UTF-8 locale=C.UTF-8 home=/httpdir