[IMP][FIX]Better multiprocess and longpolling handling for dev dev, on demand

This commit is contained in:
Fabien Bourgeois 2016-11-20 20:41:17 +01:00
parent 99bf94df7b
commit 5fc7bf20c3
5 changed files with 53 additions and 0 deletions

View File

@ -23,6 +23,8 @@ services:
image: odoo:yaltik8
environment:
DB_MAXCONN: 20
XMLRPC_PORT: 8069
LONGPOLLING_PORT: 8072
WORKERS: 2
LIMIT_TIME_CPU: 720
LIMIT_TIME_REAL: 1440

View File

@ -1,6 +1,18 @@
version: '2'
services:
nginx:
build:
context: ./nginx
dockerfile: Dockerfile.dev
image: nginx:odoodev
environment:
PORT: 80
NGINX_HOST: localhost 127.0.0.1
ODOO_SERVICE: odoo
ODOO_SERVER_NAMES: localodoo odoo ocb
command: /bin/true
odoodev:
extends:
file: base.yml

View File

@ -0,0 +1,8 @@
FROM nginx:yaltik
MAINTAINER Yaltik - Fabien Bourgeois <fabien@yaltik.com>
# Default variables
ENV ODOO_SERVER_NAMES odoo
# Copy templates and usefull files
COPY odoo.conf.dev /etc/nginx/templates/odoo.conf

29
odoo/nginx/odoo.conf.dev Normal file
View File

@ -0,0 +1,29 @@
upstream odooserver {
server ${ODOO_SERVICE}:8069 fail_timeout=300s;
}
upstream odoolongpoll {
server ${ODOO_SERVICE}:8072 fail_timeout=300s;
}
server {
listen 80;
server_name ${ODOO_SERVER_NAMES};
client_max_body_size 200M;
location / {
proxy_pass http://odooserver;
proxy_http_version 1.1;
proxy_read_timeout 300;
proxy_set_header Host ${DOLLSIGN}host;
proxy_set_header X-Real-IP ${DOLLSIGN}remote_addr;
proxy_set_header X-Forward-For ${DOLLSIGN}proxy_add_x_forwarded_for;
proxy_redirect http://$http_host/ https://$host:$server_port/;
}
location /longpolling {
proxy_pass http://odoolongpoll;
proxy_set_header Host ${DOLLSIGN}host;
proxy_set_header X-Real-IP ${DOLLSIGN}remote_addr;
proxy_set_header X-Forward-For ${DOLLSIGN}proxy_add_x_forwarded_for;
proxy_redirect off;
}
}

View File

@ -32,6 +32,8 @@ db_user = $POSTGRES_USER
db_password = $POSTGRES_PASSWORD
db_maxconn = ${DB_MAXCONN:=10}
list_db = ${LIST_DB:=True}
xmlrpc_port = ${XMLRPC_PORT:=8069}
longpolling_port = ${LONGPOLLING_PORT:=8072}
workers = ${WORKERS:=1}
limit_time_cpu = ${LIMIT_TIME_CPU:=60}
limit_time_real = ${LIMIT_TIME_REAL:=120}