diff --git a/dev/docker-compose.yml b/dev/docker-compose.yml index 0f38c1b..b68b52c 100644 --- a/dev/docker-compose.yml +++ b/dev/docker-compose.yml @@ -16,6 +16,10 @@ services: - ../lcl/repos:/repos - ../lcl/attachments:/attachments - ..:/code:z + environment: + - GL_USER=root + - PYTHONPATH=/code + - PAGURE_CONFIG=/code/dev/openshift.cfg worker: build: context: ./docker @@ -31,6 +35,21 @@ services: environment: - PYTHONPATH=. - PAGURE_CONFIG=/code/dev/openshift.cfg + logcom: + build: + context: ./docker + dockerfile: logcom + depends_on: + - redis + - postgresql + image: pagure-logcom:latest + volumes: + - ../lcl/repos:/repos + - ../lcl/attachments:/attachments:ro + - ..:/code:z + environment: + - PYTHONPATH=. + - PAGURE_CONFIG=/code/dev/openshift.cfg ev: build: context: ./docker diff --git a/dev/docker/logcom b/dev/docker/logcom new file mode 100644 index 0000000..d56c488 --- /dev/null +++ b/dev/docker/logcom @@ -0,0 +1,26 @@ +FROM registry.fedoraproject.org/fedora:27 +MAINTAINER Patrick Uiterwijk + +VOLUME ["/repos"] +RUN mkdir /code + +RUN dnf install -y python2-devel python-setuptools python-nose python2-bcrypt python-alembic \ + python-arrow python-binaryornot python-bleach python-blinker \ + python-chardet python-cryptography python-docutils python-flask \ + python-flask-wtf python-flask-multistatic python-markdown python-psutil \ + python-pygit2 python-pygments python-fedora python-openid python-openid-cla \ + python-openid-teams python-straight-plugin python-wtforms python-munch \ + python-enum34 python-redis python-sqlalchemy systemd gitolite3 python-filelock \ + python-fedora-flask python2-pillow python2-psycopg2 + +RUN dnf install -y python2-celery + +WORKDIR /code +ENTRYPOINT ["/usr/bin/celery", "-A", "pagure.lib.tasks_services", "worker", "--loglevel", "info", "-Q", "pagure_logcom"] + +# Code injection is last to make optimal use of caches +VOLUME ["/code"] +# Openshift: COPY / /code +VOLUME ["/attachments"] +# Ideally this would run as non-root, but that needs the /repos owned correctly +ENV C_FORCE_ROOT true diff --git a/pagure/hooks/files/default_hook.py b/pagure/hooks/files/default_hook.py old mode 100644 new mode 100755 index 00e13fd..00e13fd --- a/pagure/hooks/files/default_hook.py +++ b/pagure/hooks/files/default_hook.py