[UPD] docker: Clean files

This commit is contained in:
Mathieu Benoit 2020-08-01 14:17:39 -04:00
parent 49021ebd19
commit 789a26a432
5 changed files with 97 additions and 102 deletions

View file

@ -1,5 +1,5 @@
FROM debian:buster-slim
MAINTAINER Odoo S.A. <info@odoo.com>
MAINTAINER TechnoLibre <info@technolibre.ca>
SHELL ["/bin/bash", "-xo", "pipefail", "-c"]
@ -9,7 +9,6 @@ ENV LANG C.UTF-8
ENV ODOO_PREFIX /ERPLibre
ENV ODOO_EXEC_BIN $ODOO_PREFIX/odoo/odoo-bin
# Install some deps, lessc and less-plugin-clean-css, and wkhtmltopdf
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
@ -44,7 +43,6 @@ RUN apt-get update \
&& apt-get install -y --no-install-recommends ./wkhtmltox.deb \
&& rm -rf /var/lib/apt/lists/* wkhtmltox.deb
# dpkg-deb -I odoo.deb | grep Depends: | sed "s/ /\\n/g" | egrep '^python\-*' | sed "s/,//g"
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
@ -102,16 +100,13 @@ RUN cd ; mkdir -p .bin/ && \
curl https://storage.googleapis.com/git-repo-downloads/repo > /usr/bin/repo && \
chmod +x /usr/bin/repo && sed -i '1 s/python$/python3/' /usr/bin/repo
RUN groupadd --gid 101 --force odoo && \
useradd --non-unique --create-home --uid 101 --gid 101 odoo
# Copy entrypoint script and Odoo configuration file
COPY ./entrypoint.sh /
RUN chmod +x /entrypoint.sh
# # Set the default config file
ENV ODOO_RC /etc/odoo/odoo.conf
COPY ./odoo.conf $ODOO_RC

View file

@ -1,9 +1,10 @@
FROM technolibre/erplibre-base:12.0
ENV REPO_MANIFEST_URL http://git.erplibre.ca/ERPLibre
RUN cat /etc/os-release
ENV BRANCH_ERPLIBRE dev/1.1.0
RUN cat /etc/os-release
USER root
# Install Odoo
@ -22,8 +23,8 @@ RUN mkdir ~/.ssh/ && echo "StrictHostKeyChecking no" >> ~/.ssh/config && apt u
RUN cd ; mkdir -p .bin/ && \
git config --global color.ui false && \
git config --global user.email "foo@bar.io" && \
git config --global user.name "Foo Bar" && \
git config --global user.email "mathben@technolibre.ca" && \
git config --global user.name "Mathieu Benoit" && \
mkdir -p $ODOO_PREFIX && cd $ODOO_PREFIX && \
repo init -u $REPO_MANIFEST_URL -b $BRANCH_ERPLIBRE && \
repo sync -j 4 -c

View file

@ -2,25 +2,26 @@
import argparse
from os import listdir
from os.path import isdir, join, abspath
import configparser
parser = argparse.ArgumentParser(prog='Configure base dir for all addons')
parser.add_argument("addonsBaseDir", help="Path where addons are checkouted")
parser.add_argument("srcConfigPath", help="Path where we retreive source config file to adapt with new addons path")
parser.add_argument("dstConfigPath", help="Path to save adapted cpnfiguration")
parser.add_argument("addonsBaseDir", help="Path where addons are cloned.")
parser.add_argument("srcConfigPath",
help="Path where we retrieve source config file to adapt with new "
"addons path.")
parser.add_argument("dstConfigPath", help="Path to save adapted configuration.")
args = parser.parse_args()
addonsBaseDir = args.addonsBaseDir
srcConfigPath = args.srcConfigPath
dstConfigPath = args.dstConfigPath
addonsDirs = [ abspath(join(addonsBaseDir, f)) for f in listdir(addonsBaseDir) if isdir(join(addonsBaseDir, f))]
addonsDirs = [abspath(join(addonsBaseDir, f)) for f in listdir(addonsBaseDir) if
isdir(join(addonsBaseDir, f))]
# addonsDirs.insert(0, "/usr/lib/python3/dist-packages/odoo/addons/")
addonsDirs.insert(0, "/ERPLibre/odoo/addons/")

View file

@ -10,7 +10,7 @@ if __name__ == '__main__':
arg_parser.add_argument('--db_port', required=True)
arg_parser.add_argument('--db_user', required=True)
arg_parser.add_argument('--db_password', required=True)
# arg_parser.add_argument('--db_name', required=True)
arg_parser.add_argument('--db_name', required=False, default="postgres")
arg_parser.add_argument('--timeout', type=int, default=10)
args = arg_parser.parse_args()
@ -24,17 +24,15 @@ if __name__ == '__main__':
try:
conn = psycopg2.connect(user=args.db_user, host=args.db_host,
port=args.db_port, password=args.db_password,
dbname="postgres")
dbname=args.db_name)
break
except psycopg2.OperationalError as e:
error = e
print(".")
time.sleep(1)
else:
connected = True
conn.close()
print(".")
time.sleep(1)
if error:
print("Database connection failure: %s" % error, file=sys.stderr)
sys.exit(1)