diff --git a/.travis.yml b/.travis.yml index bb1fc1f..c4949fa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ services: script: - docker build -f docker/Dockerfile.base -t technolibre/erplibre-base:12.0 docker/ - - docker build -f docker/Dockerfile.dev -t technolibre/erplibre:12.0 docker/ +# - docker build -f docker/Dockerfile.dev -t technolibre/erplibre:12.0 docker/ - docker build -f docker/Dockerfile.pkg -t technolibre/erplibre:12.0-pkg docker/ after_success: diff --git a/docker-compose.yml b/docker-compose.yml index c7efb59..e96f347 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ version: "3.3" services: ERPLibre: - image: technolibre/erplibre:12.0-pkg + image: technolibre/erplibre:1.0.1 ports: - 8069:8069 - 8071:8071 @@ -17,6 +17,7 @@ services: volumes: # See the volume section at the end of the file - erplibre_data_dir:/home/odoo/.local/share/Odoo/ + - erplibre_conf:/etc/odoo db: image: postgres:12.3 @@ -33,4 +34,5 @@ services: # - docker-compose down --help volumes: erplibre_data_dir: + erplibre_conf: erplibre-db-data: diff --git a/docker/Dockerfile.base b/docker/Dockerfile.base index c8f8f68..ac44c48 100644 --- a/docker/Dockerfile.base +++ b/docker/Dockerfile.base @@ -1,5 +1,5 @@ FROM debian:buster-slim -MAINTAINER TechnoLibre +MAINTAINER TechnoLibre SHELL ["/bin/bash", "-xo", "pipefail", "-c"] @@ -113,6 +113,7 @@ RUN groupadd --gid 101 --force odoo && \ # TODO delete poetry installation # Install Poetry RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python +#curl -fsS -o get-poetry.py https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py # Copy entrypoint script and Odoo configuration file COPY ./entrypoint.sh / @@ -133,11 +134,11 @@ RUN chown odoo $ODOO_RC # Expose Odoo services EXPOSE 8069 8071 8072 -RUN mkdir -p /var/lib/odoo && \ - chown odoo /var/lib/odoo && \ - chmod 1777 /var/lib/odoo +#RUN mkdir -p /var/lib/odoo && \ +# chown odoo /var/lib/odoo && \ +# chmod 1777 /var/lib/odoo -VOLUME /var/lib/odoo +# VOLUME /var/lib/odoo # Set default user when running the container USER odoo diff --git a/docker/Dockerfile.prod.pkg b/docker/Dockerfile.prod.pkg index 1094513..15f514b 100644 --- a/docker/Dockerfile.prod.pkg +++ b/docker/Dockerfile.prod.pkg @@ -1,4 +1,4 @@ -FROM technolibre/erplibre-base:12.0 +FROM technolibre/erplibre-base:1.0.1 ENV REPO_MANIFEST_URL http://git.erplibre.ca/ERPLibre ARG WORKING_BRANCH @@ -39,7 +39,12 @@ RUN cd $ODOO_PREFIX && \ ./docker/repo_manifest_gen_org_prefix_path.py $ODOO_PREFIX/addons /etc/odoo/odoo.conf /etc/odoo/odoo.conf && \ head /etc/odoo/odoo.conf -user odoo +#RUN mkdir '/home/odoo/.local' +#RUN chown -R odoo '/home/odoo/.local' + +USER odoo + +RUN mkdir -p '/home/odoo/.local/share/Odoo/' ENTRYPOINT ["/entrypoint.sh"] CMD ["odoo"] diff --git a/docker/README.md b/docker/README.md index 6fc186f..e309337 100644 --- a/docker/README.md +++ b/docker/README.md @@ -105,3 +105,10 @@ You can change the home for docker, edit file `/etc/docker/daemon.json` } ``` And restart docker service. You can delete all older location of docker or move it. + +# Update docker +When building your docker with script +> ./script/docker_build.sh + +You need to push your docker image and update your tag, like 1.0.1: +> docker push technolibre/erplibre:1.0.1 diff --git a/docker/odoo.conf b/docker/odoo.conf index 6120a5c..b9b9c4e 100644 --- a/docker/odoo.conf +++ b/docker/odoo.conf @@ -460,7 +460,7 @@ limit_time_real = 900 # # (See chart above for recommended values) #----------------------------------------------------------------------------- -; limit_memory_soft = 255652815 +limit_memory_soft = 5368709120 #----------------------------------------------------------------------------- # Hard limit on virtual memory, any worker exceeding the limit will be @@ -471,7 +471,7 @@ limit_time_real = 900 # using PDF does not work. We are unsure why but this was the lowest amount # for it to work. #----------------------------------------------------------------------------- -; limit_memory_hard = 1395864371 +limit_memory_hard = 6710886400 #----------------------------------------------------------------------------- # Number of requests a worker will process before being recycled and restarted. diff --git a/script/build_docker.sh b/script/docker_build.sh similarity index 91% rename from script/build_docker.sh rename to script/docker_build.sh index 6c0e73f..8a7e848 100755 --- a/script/build_docker.sh +++ b/script/docker_build.sh @@ -4,10 +4,10 @@ cd docker ARGS=--build-arg=WORKING_BRANCH=$(git rev-parse --abbrev-ref HEAD) set -e # Build base -docker build ${ARGS} -f Dockerfile.base -t technolibre/erplibre-base:12.0 . +docker build ${ARGS} -f Dockerfile.base -t technolibre/erplibre-base:1.0.1 . # Build prod -docker build ${ARGS} -f Dockerfile.prod.pkg -t technolibre/erplibre:12.0-pkg . +docker build ${ARGS} -f Dockerfile.prod.pkg -t technolibre/erplibre:1.0.1 . cd .. docker-compose up -d diff --git a/script/install_locally.sh b/script/install_locally.sh index 3dbcc74..843e729 100755 --- a/script/install_locally.sh +++ b/script/install_locally.sh @@ -189,7 +189,9 @@ pyenv local 3.7.7 if [[ ! -d "${POETRY_PATH}" ]]; then echo -e "\n---- Installing poetry for reliable python package ----" - curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | ${PYTHON_EXEC} +# curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | ${PYTHON_EXEC} + curl -fsS -o get-poetry.py https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py + python get-poetry.py -y --preview fi if [[ ! -d ${VENV_PATH} ]]; then diff --git a/script/poetry_add_build_dependancy.sh b/script/poetry_add_build_dependancy.sh index ecfbc43..c7d37bc 100755 --- a/script/poetry_add_build_dependancy.sh +++ b/script/poetry_add_build_dependancy.sh @@ -1,3 +1,4 @@ #!/usr/bin/env bash source $HOME/.poetry/env poetry add -vv $(grep -v ";" ./.venv/build_dependancy.txt | grep -v "*" | sed 's/==/@^/' ) +# poetry export -f ./.venv/build_dependency.txt --dev | poetry run -- pip install -r /dev/stdin