# HG changeset patch # User Arthur Lutz # Date 1580486845 -3600 # Node ID 87b00a0cc64d530c1be833b3df3d081e0314cb02 # Parent 1983923e51cc2fea575b9a3699a686adab347ada [doc/book/admin] initial version of deploy cubicweb page in documentation diff -r 1983923e51cc -r 87b00a0cc64d doc/book/admin/deploy.rst --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc/book/admin/deploy.rst Fri Jan 31 17:07:25 2020 +0100 @@ -0,0 +1,68 @@ +.. -*- coding: utf-8 -*- + +Deploy a *CubicWeb* application +=============================== + +Deployment with uwsgi +--------------------- + +`uWSGI `_ is often used to deploy CubicWeb +applications. + +Short version is install `uwsgi`: + +.. sourcecode:: console + + apt install uwsgi + +Deploy a configuration file for your application +`/etc/uwsgi/apps-enabled/example.ini`: + +.. sourcecode:: ini + + [uwsgi] + master = true + http = 0.0.0.0:8080 + env = CW_INSTANCE=example + wsgi-file = /etc/cubicweb.d/example/wsgiapp.py + processes = 8 + threads = 1 + plugins = http,python3 + auto-procname = true + lazy-apps = true + log-master = true + # disable uwsgi request logging + disable-logging = true + stats = 127.0.0.1:1717 + +The `wsgiapp.py` file looks like this: + +.. sourcecode:: python + + import os + from cubicweb.pyramid import wsgi_application_from_cwconfig + from cubicweb.cwconfig import CubicWebConfiguration as cwcfg + + appid = os.environ['CW_INSTANCE'] # instance name + cwconfig = cwcfg.config_for(appid) + + cwconfig.log_format = ('{0} pid:{1} (%(name)s) %(levelname)s: %(message)s' + .format(appid, os.getpid())) + + application = wsgi_application_from_cwconfig(cwconfig) + repo = application.application.registry['cubicweb.repository'] + + +Deployment with SaltStack +------------------------- + +To deploy with SaltStack one can refer themselves to the +`cubicweb-formula `_. + +Deployment with Kubernetes +-------------------------- + +To deploy in a Kubernetes cluster, you can take inspiration from the +instructions included in +`the fresh cube `_ +and the `deployment yaml files `_. diff -r 1983923e51cc -r 87b00a0cc64d doc/book/admin/index.rst --- a/doc/book/admin/index.rst Fri Jan 31 16:52:24 2020 +0100 +++ b/doc/book/admin/index.rst Fri Jan 31 17:07:25 2020 +0100 @@ -14,6 +14,7 @@ :numbered: setup + deploy config cubicweb-ctl create-instance