diff --git a/ansible/tasks/install-source.yml b/ansible/tasks/install-source.yml index ab8fbfef7..4fc8b1fd8 100644 --- a/ansible/tasks/install-source.yml +++ b/ansible/tasks/install-source.yml @@ -54,6 +54,7 @@ - src: Pipfile.lock - src: README.md - src: requirements.txt + - src: gunicorn.conf.py - src: paperless.conf.example dest: "paperless.conf" diff --git a/ansible/tasks/main.yml b/ansible/tasks/main.yml index db8edcc75..6857a7c63 100644 --- a/ansible/tasks/main.yml +++ b/ansible/tasks/main.yml @@ -456,6 +456,12 @@ line: '\1' backrefs: yes +- name: configure gunicorn web server + lineinfile: + path: "{{ paperlessng_directory }}/gunicorn.conf.py" + regexp: '^bind = ' + line: "bind = '{{ paperlessng_listen_address }}:{{ paperlessng_listen_port }}'" + - name: configure systemd services ini_file: path: "{{ paperlessng_directory }}/scripts/{{ item[0] }}" @@ -498,7 +504,7 @@ path: "{{ paperlessng_directory }}/scripts/paperless-webserver.service" section: "Service" option: "ExecStart" - value: "{{ paperlessng_virtualenv }}/bin/gunicorn paperless.asgi:application -w 2 -k uvicorn.workers.UvicornWorker -b {{ paperlessng_listen_address }}:{{ paperlessng_listen_port }}" + value: "{{ paperlessng_virtualenv }}/bin/gunicorn -c {{ paperlessng_directory }}/gunicorn.conf.py paperless.asgi:application" - name: copy systemd services copy: