diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-06-08 14:05:48 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-06-09 11:09:34 +0200 |
commit | 98ee93b93a871cb5a20425657c1d63f911b235b5 (patch) | |
tree | 5167fe58d142afede1ddab10d28707b3b3ee0838 /modules/role/templates/caldance | |
parent | 6441f7dc8688f35ec926601d10d1d23359c186d3 (diff) | |
download | Puppet-98ee93b93a871cb5a20425657c1d63f911b235b5.tar.gz Puppet-98ee93b93a871cb5a20425657c1d63f911b235b5.tar.zst Puppet-98ee93b93a871cb5a20425657c1d63f911b235b5.zip |
Use uwsgi to start caldance application
Diffstat (limited to 'modules/role/templates/caldance')
-rw-r--r-- | modules/role/templates/caldance/app.ini.erb | 15 | ||||
-rw-r--r-- | modules/role/templates/caldance/caldance-app.service.erb | 20 |
2 files changed, 35 insertions, 0 deletions
diff --git a/modules/role/templates/caldance/app.ini.erb b/modules/role/templates/caldance/app.ini.erb new file mode 100644 index 0000000..baf31ac --- /dev/null +++ b/modules/role/templates/caldance/app.ini.erb | |||
@@ -0,0 +1,15 @@ | |||
1 | [uwsgi] | ||
2 | chdir = <%= @caldance_app %> | ||
3 | wsgi-file = main_app/wsgi.py | ||
4 | |||
5 | master = true | ||
6 | processes = 10 | ||
7 | gevent = 1000 | ||
8 | http-websockets = true | ||
9 | |||
10 | socket = <%= @socket %> | ||
11 | chmod-socket = 666 | ||
12 | vacuum = true | ||
13 | |||
14 | die-on-term = true | ||
15 | |||
diff --git a/modules/role/templates/caldance/caldance-app.service.erb b/modules/role/templates/caldance/caldance-app.service.erb new file mode 100644 index 0000000..f5694bf --- /dev/null +++ b/modules/role/templates/caldance/caldance-app.service.erb | |||
@@ -0,0 +1,20 @@ | |||
1 | [Unit] | ||
2 | Description=Caldance application | ||
3 | After=network.target | ||
4 | |||
5 | [Service] | ||
6 | WorkingDirectory=<%= @caldance_app %> | ||
7 | |||
8 | <% @environment.each do |env, val| %> | ||
9 | Environment=<%= env %>="<%= val %>" | ||
10 | <% end %> | ||
11 | EnvironmentFile=<%= @home %>/caldance_env | ||
12 | Type=simple | ||
13 | User=<%= @user %> | ||
14 | Group=<%= @group %> | ||
15 | ExecStart=<%= @uwsgi_path %> <%= @caldance_app %>/app.ini | ||
16 | RuntimeDirectory=caldance | ||
17 | |||
18 | [Install] | ||
19 | WantedBy=multi-user.target | ||
20 | |||