mirror of
https://github.com/frappe/bench.git
synced 2025-01-09 16:36:25 +00:00
Add socketio config
This commit is contained in:
parent
bc7376b188
commit
7faad21fa4
@ -3,6 +3,7 @@ import getpass
|
||||
import json
|
||||
import subprocess
|
||||
import shutil
|
||||
from distutils.spawn import find_executable
|
||||
from jinja2 import Environment, PackageLoader
|
||||
from .utils import get_sites, get_config, update_config, get_redis_version
|
||||
|
||||
@ -35,7 +36,8 @@ def generate_supervisor_config(bench='.', user=None):
|
||||
"sites_dir": sites_dir,
|
||||
"user": user,
|
||||
"http_timeout": config.get("http_timeout", 120),
|
||||
"redis_server": subprocess.check_output('which redis-server', shell=True).strip(),
|
||||
"redis_server": find_executable('redis-server'),
|
||||
"node": find_executable('node'),
|
||||
"redis_cache_config": os.path.join(bench_dir, 'config', 'redis_cache.conf'),
|
||||
"redis_async_broker_config": os.path.join(bench_dir, 'config', 'redis_async_broker.conf'),
|
||||
"frappe_version": get_current_frappe_version()
|
||||
|
@ -5,6 +5,10 @@ upstream frappe {
|
||||
server 127.0.0.1:8000 fail_timeout=0;
|
||||
}
|
||||
|
||||
upstream socketio-server {
|
||||
server 127.0.0.1:3000 fail_timeout=0;
|
||||
}
|
||||
|
||||
{% macro location_block(site, port=80, default=False, server_name=None, sites=None, dns_multitenant=False) -%}
|
||||
keepalive_timeout 5;
|
||||
sendfile on;
|
||||
@ -19,6 +23,13 @@ upstream frappe {
|
||||
try_files $uri =404;
|
||||
}
|
||||
|
||||
location /socket.io {
|
||||
proxy_pass http://socketio-server;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
}
|
||||
|
||||
location / {
|
||||
try_files /{{ "$host" if dns_multitenant else site.name }}/public/$uri @magic;
|
||||
}
|
||||
|
@ -51,6 +51,19 @@ stdout_logfile={{ bench_dir }}/logs/redis-async-broker.log
|
||||
stderr_logfile={{ bench_dir }}/logs/redis-async-broker.error.log
|
||||
user={{ user }}
|
||||
directory={{ sites_dir }}
|
||||
|
||||
{% if node %}
|
||||
[program:node-socketio]
|
||||
command={{ node }} apps/frappe/socketio.js
|
||||
autostart=true
|
||||
autorestart=true
|
||||
stopsignal=QUIT
|
||||
stdout_logfile={{ bench_dir }}/logs/node-socketio.log
|
||||
stderr_logfile={{ bench_dir }}/logs/node-socketio.error.log
|
||||
user={{ user }}
|
||||
directory={{ sites_dir }}
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
[group:frappe]
|
||||
|
Loading…
Reference in New Issue
Block a user