[IMP] docker and nginx template for odoo 12, 14 and 16
This commit is contained in:
parent
a0c86c1866
commit
f77f521bf3
6 changed files with 351 additions and 15 deletions
50
docker/docker-compose_odoo_12.0.yml
Normal file
50
docker/docker-compose_odoo_12.0.yml
Normal file
|
|
@ -0,0 +1,50 @@
|
||||||
|
version: "3.3"
|
||||||
|
services:
|
||||||
|
ERPLibre:
|
||||||
|
image: technolibre/erplibre:1.5.0_1f40c56
|
||||||
|
ports:
|
||||||
|
- 8069:8069
|
||||||
|
- 8071:8071
|
||||||
|
- 8072:8072
|
||||||
|
environment:
|
||||||
|
HOST: db
|
||||||
|
PASSWORD: mysecretpassword
|
||||||
|
USER: odoo
|
||||||
|
POSTGRES_DB: postgres
|
||||||
|
STOP_BEFORE_INIT: "False"
|
||||||
|
DB_NAME: ""
|
||||||
|
UPDATE_ALL_DB: "False"
|
||||||
|
depends_on:
|
||||||
|
- db
|
||||||
|
# not behind a proxy
|
||||||
|
#command: odoo --workers 0
|
||||||
|
# behind a proxy
|
||||||
|
#command: odoo --workers 2 --proxy-mode
|
||||||
|
# For production ready
|
||||||
|
#command: odoo --workers 2 --proxy-mode --no-database-list
|
||||||
|
command: odoo
|
||||||
|
volumes:
|
||||||
|
# See the volume section at the end of the file
|
||||||
|
- erplibre_data_dir:/home/odoo/.local/share/Odoo
|
||||||
|
- ./addons/addons:/ERPLibre/addons/addons
|
||||||
|
- erplibre_conf:/etc/odoo
|
||||||
|
restart: always
|
||||||
|
|
||||||
|
db:
|
||||||
|
image: postgis/postgis:12-3.1-alpine
|
||||||
|
environment:
|
||||||
|
POSTGRES_PASSWORD: mysecretpassword
|
||||||
|
POSTGRES_USER: odoo
|
||||||
|
POSTGRES_DB: postgres
|
||||||
|
PGDATA: /var/lib/postgresql/data/pgdata
|
||||||
|
volumes:
|
||||||
|
- erplibre-db-data:/var/lib/postgresql/data/pgdata
|
||||||
|
restart: always
|
||||||
|
|
||||||
|
# We configure volume without specific destination to let docker manage it. To configure it through docker use (read related documentation before continuing) :
|
||||||
|
# - docker volume --help
|
||||||
|
# - docker-compose down --help
|
||||||
|
volumes:
|
||||||
|
erplibre_data_dir:
|
||||||
|
erplibre_conf:
|
||||||
|
erplibre-db-data:
|
||||||
50
docker/docker-compose_odoo_14.0.yml
Normal file
50
docker/docker-compose_odoo_14.0.yml
Normal file
|
|
@ -0,0 +1,50 @@
|
||||||
|
version: "3.3"
|
||||||
|
services:
|
||||||
|
ERPLibre:
|
||||||
|
image: technolibre/erplibre:1.5.0_odoo_14.0_29e1957
|
||||||
|
ports:
|
||||||
|
- 8069:8069
|
||||||
|
- 8071:8071
|
||||||
|
- 8072:8072
|
||||||
|
environment:
|
||||||
|
HOST: db
|
||||||
|
PASSWORD: mysecretpassword
|
||||||
|
USER: odoo
|
||||||
|
POSTGRES_DB: postgres
|
||||||
|
STOP_BEFORE_INIT: "False"
|
||||||
|
DB_NAME: ""
|
||||||
|
UPDATE_ALL_DB: "False"
|
||||||
|
depends_on:
|
||||||
|
- db
|
||||||
|
# not behind a proxy
|
||||||
|
#command: odoo --workers 0
|
||||||
|
# behind a proxy
|
||||||
|
#command: odoo --workers 2 --proxy-mode
|
||||||
|
# For production ready
|
||||||
|
#command: odoo --workers 2 --proxy-mode --no-database-list
|
||||||
|
command: odoo
|
||||||
|
volumes:
|
||||||
|
# See the volume section at the end of the file
|
||||||
|
- erplibre_data_dir:/home/odoo/.local/share/Odoo
|
||||||
|
- ./addons/addons:/ERPLibre/addons/addons
|
||||||
|
- erplibre_conf:/etc/odoo
|
||||||
|
restart: always
|
||||||
|
|
||||||
|
db:
|
||||||
|
image: postgis/postgis:12-3.1-alpine
|
||||||
|
environment:
|
||||||
|
POSTGRES_PASSWORD: mysecretpassword
|
||||||
|
POSTGRES_USER: odoo
|
||||||
|
POSTGRES_DB: postgres
|
||||||
|
PGDATA: /var/lib/postgresql/data/pgdata
|
||||||
|
volumes:
|
||||||
|
- erplibre-db-data:/var/lib/postgresql/data/pgdata
|
||||||
|
restart: always
|
||||||
|
|
||||||
|
# We configure volume without specific destination to let docker manage it. To configure it through docker use (read related documentation before continuing) :
|
||||||
|
# - docker volume --help
|
||||||
|
# - docker-compose down --help
|
||||||
|
volumes:
|
||||||
|
erplibre_data_dir:
|
||||||
|
erplibre_conf:
|
||||||
|
erplibre-db-data:
|
||||||
50
docker/docker-compose_odoo_16.0.yml
Normal file
50
docker/docker-compose_odoo_16.0.yml
Normal file
|
|
@ -0,0 +1,50 @@
|
||||||
|
version: "3.3"
|
||||||
|
services:
|
||||||
|
ERPLibre:
|
||||||
|
image: technolibre/erplibre:1.5.0_odoo_16.0_91a7d1b
|
||||||
|
ports:
|
||||||
|
- 8069:8069
|
||||||
|
- 8071:8071
|
||||||
|
- 8072:8072
|
||||||
|
environment:
|
||||||
|
HOST: db
|
||||||
|
PASSWORD: mysecretpassword
|
||||||
|
USER: odoo
|
||||||
|
POSTGRES_DB: postgres
|
||||||
|
STOP_BEFORE_INIT: "False"
|
||||||
|
DB_NAME: ""
|
||||||
|
UPDATE_ALL_DB: "False"
|
||||||
|
depends_on:
|
||||||
|
- db
|
||||||
|
# not behind a proxy
|
||||||
|
#command: odoo --workers 0
|
||||||
|
# behind a proxy
|
||||||
|
#command: odoo --workers 2 --proxy-mode
|
||||||
|
# For production ready
|
||||||
|
#command: odoo --workers 2 --proxy-mode --no-database-list
|
||||||
|
command: odoo
|
||||||
|
volumes:
|
||||||
|
# See the volume section at the end of the file
|
||||||
|
- erplibre_data_dir:/home/odoo/.local/share/Odoo
|
||||||
|
- ./addons/addons:/ERPLibre/addons/addons
|
||||||
|
- erplibre_conf:/etc/odoo
|
||||||
|
restart: always
|
||||||
|
|
||||||
|
db:
|
||||||
|
image: postgis/postgis:12-3.1-alpine
|
||||||
|
environment:
|
||||||
|
POSTGRES_PASSWORD: mysecretpassword
|
||||||
|
POSTGRES_USER: odoo
|
||||||
|
POSTGRES_DB: postgres
|
||||||
|
PGDATA: /var/lib/postgresql/data/pgdata
|
||||||
|
volumes:
|
||||||
|
- erplibre-db-data:/var/lib/postgresql/data/pgdata
|
||||||
|
restart: always
|
||||||
|
|
||||||
|
# We configure volume without specific destination to let docker manage it. To configure it through docker use (read related documentation before continuing) :
|
||||||
|
# - docker volume --help
|
||||||
|
# - docker-compose down --help
|
||||||
|
volumes:
|
||||||
|
erplibre_data_dir:
|
||||||
|
erplibre_conf:
|
||||||
|
erplibre-db-data:
|
||||||
|
|
@ -1,15 +1,15 @@
|
||||||
# TODO replace test1 by your hostname and fix server_name and run certbot
|
# TODO replace CHANGEME by your hostname and fix server_name and run certbot
|
||||||
upstream erplibretest1 {
|
upstream erplibreCHANGEME {
|
||||||
server 127.0.0.1:10000;
|
server 127.0.0.1:8069;
|
||||||
}
|
}
|
||||||
upstream erplibretest1chat {
|
upstream erplibreCHANGEMEchat {
|
||||||
server 127.0.0.1:10002;
|
server 127.0.0.1:8072;
|
||||||
}
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 80;
|
||||||
|
|
||||||
server_name test1.ca;
|
server_name CHANGEME.ca;
|
||||||
|
|
||||||
# Add Headers for erplibre proxy mode
|
# Add Headers for erplibre proxy mode
|
||||||
proxy_set_header X-Forwarded-Host $host;
|
proxy_set_header X-Forwarded-Host $host;
|
||||||
|
|
@ -20,8 +20,8 @@ server {
|
||||||
add_header X-XSS-Protection "1; mode=block";
|
add_header X-XSS-Protection "1; mode=block";
|
||||||
|
|
||||||
# erplibre request log files
|
# erplibre request log files
|
||||||
access_log /var/log/nginx/test1-access.log;
|
access_log /var/log/nginx/CHANGEME-access.log;
|
||||||
error_log /var/log/nginx/test1-error.log;
|
error_log /var/log/nginx/CHANGEME-error.log;
|
||||||
|
|
||||||
# Increase proxy buffer size
|
# Increase proxy buffer size
|
||||||
proxy_buffers 16 64k;
|
proxy_buffers 16 64k;
|
||||||
|
|
@ -51,21 +51,21 @@ server {
|
||||||
client_max_body_size 1024M;
|
client_max_body_size 1024M;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
proxy_pass http://erplibretest1;
|
proxy_pass http://erplibreCHANGEME;
|
||||||
# by default, do not forward anything
|
# by default, do not forward anything
|
||||||
proxy_redirect off;
|
proxy_redirect off;
|
||||||
}
|
}
|
||||||
|
|
||||||
location /longpolling {
|
location /longpolling {
|
||||||
proxy_pass http://erplibretest1chat;
|
proxy_pass http://erplibreCHANGEMEchat;
|
||||||
}
|
}
|
||||||
|
|
||||||
# cache some static data in memory for 60mins.
|
# cache some static data in memory for 60mins.
|
||||||
location ~ /[a-zA-Z0-9_-]*/static/ {
|
location ~ /[a-zA-Z0-9_-]*/static/ {
|
||||||
proxy_cache_valid 200 302 60m;
|
proxy_cache_valid 200 302 60m;
|
||||||
proxy_cache_valid 404 1m;
|
proxy_cache_valid 404 1m;
|
||||||
proxy_buffering on;
|
proxy_buffering on;
|
||||||
expires 864000;
|
expires 864000;
|
||||||
proxy_pass http://erplibretest1;
|
proxy_pass http://erplibreCHANGEME;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
93
script/nginx/template_nginx_odoo_14.0.txt
Normal file
93
script/nginx/template_nginx_odoo_14.0.txt
Normal file
|
|
@ -0,0 +1,93 @@
|
||||||
|
# TODO replace CHANGEME by your hostname and fix server_name and run certbot
|
||||||
|
upstream erplibreCHANGEME {
|
||||||
|
server 127.0.0.1:8069;
|
||||||
|
}
|
||||||
|
upstream erplibreCHANGEMEchat {
|
||||||
|
server 127.0.0.1:8072;
|
||||||
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
|
||||||
|
server_name CHANGEME.ca;
|
||||||
|
|
||||||
|
# Add Headers for erplibre proxy mode
|
||||||
|
proxy_set_header X-Forwarded-Host $host;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
add_header X-Frame-Options "SAMEORIGIN";
|
||||||
|
add_header X-XSS-Protection "1; mode=block";
|
||||||
|
|
||||||
|
# erplibre request log files
|
||||||
|
access_log /var/log/nginx/CHANGEME-access.log;
|
||||||
|
error_log /var/log/nginx/CHANGEME-error.log;
|
||||||
|
|
||||||
|
# Increase proxy buffer size
|
||||||
|
proxy_buffers 16 64k;
|
||||||
|
proxy_buffer_size 128k;
|
||||||
|
|
||||||
|
proxy_read_timeout 720s;
|
||||||
|
proxy_connect_timeout 720s;
|
||||||
|
proxy_send_timeout 720s;
|
||||||
|
|
||||||
|
# Force timeouts if the backend dies
|
||||||
|
proxy_next_upstream error timeout invalid_header http_500 http_502
|
||||||
|
http_503;
|
||||||
|
|
||||||
|
types {
|
||||||
|
text/less less;
|
||||||
|
text/scss scss;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Enable data compression
|
||||||
|
gzip on;
|
||||||
|
gzip_min_length 1100;
|
||||||
|
gzip_buffers 4 32k;
|
||||||
|
gzip_types text/css text/less text/plain text/xml application/xml application/json application/javascript application/pdf image/jpeg image/png;
|
||||||
|
gzip_vary on;
|
||||||
|
client_header_buffer_size 4k;
|
||||||
|
large_client_header_buffers 4 64k;
|
||||||
|
client_max_body_size 1024M;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_pass http://erplibreCHANGEME;
|
||||||
|
# by default, do not forward anything
|
||||||
|
proxy_redirect off;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection "upgrade";
|
||||||
|
proxy_read_timeout 720s;
|
||||||
|
proxy_connect_timeout 720s;
|
||||||
|
proxy_send_timeout 720s;
|
||||||
|
# Add Headers for odoo proxy mode
|
||||||
|
proxy_set_header X-Forwarded-Host $host;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /websocket {
|
||||||
|
proxy_pass http://erplibreCHANGEMEchat;
|
||||||
|
proxy_read_timeout 720s;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection "upgrade";
|
||||||
|
proxy_connect_timeout 720s;
|
||||||
|
proxy_send_timeout 720s;
|
||||||
|
# Add Headers for odoo proxy mode
|
||||||
|
proxy_set_header X-Forwarded-Host $host;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
}
|
||||||
|
|
||||||
|
# cache some static data in memory for 60mins.
|
||||||
|
location ~ /[a-zA-Z0-9_-]*/static/ {
|
||||||
|
proxy_cache_valid 200 302 60m;
|
||||||
|
proxy_cache_valid 404 1m;
|
||||||
|
proxy_buffering on;
|
||||||
|
expires 864000;
|
||||||
|
proxy_pass http://erplibreCHANGEME;
|
||||||
|
}
|
||||||
|
}
|
||||||
93
script/nginx/template_nginx_odoo_16.0.txt
Normal file
93
script/nginx/template_nginx_odoo_16.0.txt
Normal file
|
|
@ -0,0 +1,93 @@
|
||||||
|
# TODO replace CHANGEME by your hostname and fix server_name and run certbot
|
||||||
|
upstream erplibreCHANGEME {
|
||||||
|
server 127.0.0.1:8069;
|
||||||
|
}
|
||||||
|
upstream erplibreCHANGEMEchat {
|
||||||
|
server 127.0.0.1:8072;
|
||||||
|
}
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
|
||||||
|
server_name CHANGEME.ca;
|
||||||
|
|
||||||
|
# Add Headers for erplibre proxy mode
|
||||||
|
proxy_set_header X-Forwarded-Host $host;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
add_header X-Frame-Options "SAMEORIGIN";
|
||||||
|
add_header X-XSS-Protection "1; mode=block";
|
||||||
|
|
||||||
|
# erplibre request log files
|
||||||
|
access_log /var/log/nginx/CHANGEME-access.log;
|
||||||
|
error_log /var/log/nginx/CHANGEME-error.log;
|
||||||
|
|
||||||
|
# Increase proxy buffer size
|
||||||
|
proxy_buffers 16 64k;
|
||||||
|
proxy_buffer_size 128k;
|
||||||
|
|
||||||
|
proxy_read_timeout 720s;
|
||||||
|
proxy_connect_timeout 720s;
|
||||||
|
proxy_send_timeout 720s;
|
||||||
|
|
||||||
|
# Force timeouts if the backend dies
|
||||||
|
proxy_next_upstream error timeout invalid_header http_500 http_502
|
||||||
|
http_503;
|
||||||
|
|
||||||
|
types {
|
||||||
|
text/less less;
|
||||||
|
text/scss scss;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Enable data compression
|
||||||
|
gzip on;
|
||||||
|
gzip_min_length 1100;
|
||||||
|
gzip_buffers 4 32k;
|
||||||
|
gzip_types text/css text/less text/plain text/xml application/xml application/json application/javascript application/pdf image/jpeg image/png;
|
||||||
|
gzip_vary on;
|
||||||
|
client_header_buffer_size 4k;
|
||||||
|
large_client_header_buffers 4 64k;
|
||||||
|
client_max_body_size 1024M;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_pass http://erplibreCHANGEME;
|
||||||
|
# by default, do not forward anything
|
||||||
|
proxy_redirect off;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection "upgrade";
|
||||||
|
proxy_read_timeout 720s;
|
||||||
|
proxy_connect_timeout 720s;
|
||||||
|
proxy_send_timeout 720s;
|
||||||
|
# Add Headers for odoo proxy mode
|
||||||
|
proxy_set_header X-Forwarded-Host $host;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /websocket {
|
||||||
|
proxy_pass http://erplibreCHANGEMEchat;
|
||||||
|
proxy_read_timeout 720s;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection "upgrade";
|
||||||
|
proxy_connect_timeout 720s;
|
||||||
|
proxy_send_timeout 720s;
|
||||||
|
# Add Headers for odoo proxy mode
|
||||||
|
proxy_set_header X-Forwarded-Host $host;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
}
|
||||||
|
|
||||||
|
# cache some static data in memory for 60mins.
|
||||||
|
location ~ /[a-zA-Z0-9_-]*/static/ {
|
||||||
|
proxy_cache_valid 200 302 60m;
|
||||||
|
proxy_cache_valid 404 1m;
|
||||||
|
proxy_buffering on;
|
||||||
|
expires 864000;
|
||||||
|
proxy_pass http://erplibreCHANGEME;
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue