[IMP]Odoo v16 : use caddy v16 + new options on config file

This commit is contained in:
Fabien BOURGEOIS 2022-10-31 12:43:56 +01:00
parent 1514217c80
commit aaf927cbea
5 changed files with 66 additions and 1 deletions

5
odoo/caddy/Caddyfile.16 Normal file
View File

@ -0,0 +1,5 @@
import /caddycommon
{$ODOO_SERVER_NAMES} {
import odoo16 {$ODOO_SERVICE}
}

View File

@ -0,0 +1,8 @@
FROM registry.yaltik.net/caddy:yaltik
LABEL maintainer="Yaltik - Fabien Bourgeois <fabien@yaltik.com>"
# Default variables
ENV ODOO_SERVICE="odoo" ODOO_SERVER_NAMES="odoo"
# Configuration
COPY Caddyfile.16 /etc/caddy/Caddyfile

View File

@ -13,6 +13,12 @@ services:
dockerfile: Dockerfile.dev
image: registry.yaltik.net/caddy:odoodev
caddy16:
build:
context: ./caddy
dockerfile: Dockerfile.16.dev
image: registry.yaltik.net/caddy:odoodev16
odoo8c7dev:
build:
context: ./odoo

View File

@ -70,7 +70,7 @@ RUN mkdir pipcache data backups extra-addons custom-addons && \
# Launch scripts
COPY ./launch14.sh ./launch.sh
COPY ./genconf.sh ./
COPY ./genconf16.sh ./genconf.sh
# Post-install tasks
RUN touch odoo.conf

46
odoo/odoo/genconf16.sh Normal file
View File

@ -0,0 +1,46 @@
#!/bin/bash
# Small program, inspired from Yajo's one : https://bitbucket.org/yajo/docker-odoo
# It generates configuration file
CONF=/opt/odoo/odoo.conf
ADDONS_PATH="/opt/odoo/OCB/addons,/opt/odoo/data/addons"
cd extra-addons
for d in */ ; do
if ! [ "$d" == "*/" ]; then
ADDONS_PATH="$ADDONS_PATH,/opt/odoo/extra-addons/$d"
fi
done
cd ../custom-addons
for d in */ ; do
if ! [ "$d" == "*/" ]; then
ADDONS_PATH="$ADDONS_PATH,/opt/odoo/custom-addons/$d"
fi
done
# Configuration generation
echo "
[options]
; Configuration file auto-generated
addons_path = $ADDONS_PATH
data_dir = ${DATA:=/opt/odoo/data}
dbfilter = ${DB_FILTER}
db_name = ${DB_NAME}
db_host = ${DB_HOST:=postgres}
db_port = ${DB_PORT:=5432}
db_user = ${POSTGRES_USER:=odoo}
db_password = $POSTGRES_PASSWORD
db_maxconn = ${DB_MAXCONN:=20}
list_db = ${LIST_DB:=True}
http_port = ${XMLRPC_PORT:=8069}
gevent_port = ${LONGPOLLING_PORT:=8072}
proxy_mode = ${PROXY_MODE:=True}
workers = ${WORKERS:=2}
limit_time_cpu = ${LIMIT_TIME_CPU:=120}
limit_time_real = ${LIMIT_TIME_REAL:=240}
limit_memory_soft = ${LIMIT_MEMORY_SOFT:=2684354560}
limit_memory_hard = ${LIMIT_MEMORY_HARD:=6442450944}
database_from_hosts = ${DATABASE_FROM_HOSTS}
admin_passwd = ${ADMIN_PASSWORD:=admin}" > $CONF