[IMP]Odoo service : shell handling for dev environments

This commit is contained in:
Fabien Bourgeois 2016-10-03 19:48:09 +02:00
parent c058a76f78
commit b53b544e54
7 changed files with 29 additions and 8 deletions

View File

@ -4,6 +4,10 @@ services:
extends:
file: base.yml
service: odoo
build:
context: ./odoo
dockerfile: Dockerfile.dev
image: odoodev:8.0
environment:
ADMIN_PASSWORD: admin
LIST_DB: "True"
@ -11,3 +15,5 @@ services:
WORKERS: 4
LIMIT_TIME_CPU: 3000
LIMIT_TIME_REAL: 6000
volumes:
- /home/fabien/tmp/programming/py/server-tools:/opt/odoo/custom-addons/server-tools:ro

View File

@ -1,7 +1,7 @@
version: '2'
services:
odoo:
build: ./golem
build: .
image: golem:base
extends:
file: ../base.yml

View File

@ -55,7 +55,8 @@ VOLUME "/opt/odoo/data"
# Odoo default ports
EXPOSE 8069 8071
COPY ./launch ./
COPY ./launch.sh ./
COPY ./genconf.sh ./
# Default user : odoo
USER odoo
CMD [ "bash", "launch" ]
CMD [ "bash", "launch.sh" ]

8
odoo/odoo/Dockerfile.dev Normal file
View File

@ -0,0 +1,8 @@
FROM odoo:8.0
MAINTAINER Yaltik - Fabien Bourgeois <fabien@yaltik.com>
WORKDIR /opt/odoo/extra-addons
RUN git clone --depth 1 -b 8.0 https://github.com/OCA/server-tools
WORKDIR /opt/odoo
ADD shell.sh ./

6
odoo/odoo/launch → odoo/odoo/genconf.sh Executable file → Normal file
View File

@ -1,10 +1,9 @@
#!/bin/bash
# Small program, inspired from Yajo's one : https://bitbucket.org/yajo/docker-odoo
# It generates configuration file and launch OCB Odoo
# It generates configuration file
CONF=/opt/odoo/odoo.conf
ODOOCMD="python /opt/odoo/OCB/odoo.py --config $CONF"
ADDONS_PATH="/opt/odoo/OCB/addons,/opt/odoo/data/addons"
cd extra-addons
@ -37,6 +36,3 @@ workers = ${WORKERS:=1}
limit_time_cpu = ${LIMIT_TIME_CPU:=60}
limit_time_real = ${LIMIT_TIME_REAL:=120}
admin_passwd = ${ADMIN_PASSWORD:=admin}" > $CONF
# Odoo launch
$ODOOCMD

7
odoo/odoo/launch.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/bash
CONF=/opt/odoo/odoo.conf
ODOOCMD="python /opt/odoo/OCB/odoo.py --config $CONF"
# Configuration generation and Odoo launch
bash genconf.sh && $ODOOCMD

3
odoo/odoo/shell.sh Normal file
View File

@ -0,0 +1,3 @@
#!/bin/bash
python OCB/odoo.py --addons-path=/opt/odoo/custom-addons/server-tools/ shell -c odoo.conf -d "$@" --xmlrpc-port=8999