From 0790a9243b3272fd772833f31cea118accd9374d Mon Sep 17 00:00:00 2001 From: Disassembler Date: Fri, 20 Mar 2020 20:22:27 +0100 Subject: [PATCH] Make Odoo SPOC-compatible --- lxc-apps/odoo/app | 27 ++++++++++++++++++++ lxc-apps/odoo/{lxcfile => image} | 6 ++--- lxc-apps/odoo/install.sh | 42 ++++++++++++++++---------------- lxc-apps/odoo/meta | 27 -------------------- lxc-apps/odoo/uninstall.sh | 2 +- 5 files changed, 52 insertions(+), 52 deletions(-) create mode 100644 lxc-apps/odoo/app rename lxc-apps/odoo/{lxcfile => image} (91%) delete mode 100644 lxc-apps/odoo/meta diff --git a/lxc-apps/odoo/app b/lxc-apps/odoo/app new file mode 100644 index 0000000..7151fab --- /dev/null +++ b/lxc-apps/odoo/app @@ -0,0 +1,27 @@ +{ + "version": "13.0.0-200313", + "meta": { + "title": "Odoo", + "desc-cs": "Sada aplikací pro správu organizace", + "desc-en": "Company management application suite", + "license": "GPL" + }, + "containers": { + "odoo": { + "image": "odoo_13.0.0-200313", + "depends": [ + "odoo-postgres" + ], + "mounts": { + "odoo/odoo_data": "srv/odoo/data", + "odoo/odoo_conf/odoo.conf": "srv/odoo/odoo.conf:file" + } + }, + "odoo-postgres": { + "image": "postgres_12.2.0-200313", + "mounts": { + "odoo/postgres_data": "var/lib/postgresql" + } + } + } +} diff --git a/lxc-apps/odoo/lxcfile b/lxc-apps/odoo/image similarity index 91% rename from lxc-apps/odoo/lxcfile rename to lxc-apps/odoo/image index 2eba772..e70a6d6 100644 --- a/lxc-apps/odoo/lxcfile +++ b/lxc-apps/odoo/image @@ -1,5 +1,5 @@ -IMAGE odoo_13.0.0-191113 -FROM alpine3.9-python3.6_3.6.8-190620 +IMAGE odoo_13.0.0-200313 +FROM alpine3.11-python3.8_3.8.2-200313 RUN EOF # Install runtime dependencies @@ -26,5 +26,5 @@ RUN EOF rm -rf /usr/local/share/.cache EOF -USER 8080 8080 +USER odoo CMD /srv/odoo/odoo-bin -c srv/odoo/odoo.conf diff --git a/lxc-apps/odoo/install.sh b/lxc-apps/odoo/install.sh index 6a3d4ab..4787f0d 100755 --- a/lxc-apps/odoo/install.sh +++ b/lxc-apps/odoo/install.sh @@ -1,45 +1,45 @@ #!/bin/sh set -ev +# Volumes +POSTGRES_DATA="${VOLUMES_DIR}/odoo/postgres_data" +ODOO_CONF="${VOLUMES_DIR}/odoo/odoo_conf" +ODOO_DATA="${VOLUMES_DIR}/odoo/odoo_data" + # Create Postgres instance -mkdir -p /srv/odoo/postgres_data -chown -R 105432:105432 /srv/odoo/postgres_data -chmod 700 /srv/odoo/postgres_data -lxc-execute -n odoo-postgres -- initdb -D /var/lib/postgresql +install -o 105432 -g 105432 -m 700 -d ${POSTGRES_DATA} +spoc-container exec odoo-postgres -- initdb -D /var/lib/postgresql # Configure Postgres -cp postgres_data/postgresql.conf /srv/odoo/postgres_data/postgresql.conf -cp postgres_data/pg_hba.conf /srv/odoo/postgres_data/pg_hba.conf +install -o 105432 -g 105432 -m 600 postgres_data/postgresql.conf ${POSTGRES_DATA}/postgresql.conf +install -o 105432 -g 105432 -m 600 postgres_data/pg_hba.conf ${POSTGRES_DATA}/pg_hba.conf # Create databases export ODOO_PWD=$(head -c 18 /dev/urandom | base64 | tr -d '+/=') -service lxc-odoo-postgres start -envsubst /srv/odoo/odoo_conf/odoo.conf -chown 100000:100000 /srv/odoo/odoo_conf/ -chown 108080:108080 /srv/odoo/odoo_data/ +install -o 108080 -g 108080 -m 750 -d ${ODOO_CONF} +install -o 108080 -g 108080 -m 750 -d ${ODOO_DATA} +envsubst