Skip to content

Commit

Permalink
Improved deployment docs (#1457)
Browse files Browse the repository at this point in the history
Co-authored-by: Ronnie van den Crommenacker <ronnie@owello.nl>
  • Loading branch information
ronnievdc and Ronnie van den Crommenacker committed Jun 23, 2020
1 parent 47c661e commit 486663a
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions docs/deploying.rst
Original file line number Diff line number Diff line change
Expand Up @@ -221,13 +221,32 @@ share the same bound port:
stdout_logfile=/your/log/asgi.log
redirect_stderr=true
Create the run directory for the sockets referenced in the supervisor configuration file.

.. code-block:: sh
$ sudo mkdir /run/daphne/
When running the supervisor fcgi-program under a different user, change the owner settings of the run directory.

.. code-block:: sh
$ sudo chown <user>.<user> /run/daphne/
Have supervisor reread and update its jobs:

.. code-block:: sh
$ sudo supervisorctl reread
$ sudo supervisorctl update
.. note::
Running the daphe command with ``--fd 0`` in the commandline will fail and result in *[Errno 88] Socket operation on non-socket*.

Supervisor will automatically create the socket, bind, and listen before forking the first child in a group.
The socket will be passed to each child on file descriptor number 0 (zero).
See http://supervisord.org/configuration.html#fcgi-program-x-section-settings

Next, Nginx has to be told to proxy traffic to the running Daphne instances.
Setup your nginx upstream conf file for your project:

Expand Down Expand Up @@ -264,3 +283,4 @@ Reload nginx to apply the changes:
.. code-block:: sh
$ sudo service nginx reload

0 comments on commit 486663a

Please sign in to comment.