diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index afc9c1b..eb6ff5c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,33 +1,45 @@ - -name: Docker Image CI +name: Build and Push Docker Image to Docker Hub on: - schedule: - - cron: '30 5 10,20 * *' push: - branches: [ 15.0 ] - workflow_dispatch: + branches: [ "17.0" ] + pull_request: + branches: [ "17.0" ] -jobs: +env: + # Use docker.io for Docker Hub if empty + REGISTRY: docker.io + # github.repository as / + IMAGE_NAME: ${{ github.repository }} - build: +jobs: + push_to_registry: + name: Push Docker image to Docker Hub runs-on: ubuntu-latest - steps: - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - - name: Login to DockerHub - uses: docker/login-action@v1 + - name: Check out the repo + uses: actions/checkout@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Log in to Docker Hub + uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Build and push - id: docker_build + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Build and push Docker image uses: docker/build-push-action@v2 with: + context: "{{defaultContext}}" push: true - tags: trustcode/docker-odoo-base:15.0 + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/Dockerfile b/Dockerfile index 0980459..86a446c 100755 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:20.04 +FROM ubuntu:22.04 ENV DEBIAN_FRONTEND noninteractive ENV TERM=xterm @@ -7,41 +7,37 @@ RUN echo "#!/bin/sh\nexit 0" > /usr/sbin/policy-rc.d ##### Dependências ##### -RUN apt-get update +RUN apt update && apt install gnupg2 wget curl -y ADD conf/apt-requirements /opt/sources/ -ADD conf/pip-requirements /opt/sources/ + +RUN echo "deb http://apt.postgresql.org/pub/repos/apt jammy-pgdg main" > /etc/apt/sources.list.d/pgdg.list +RUN curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor -o /etc/apt/trusted.gpg.d/postgresql.gpg +RUN apt update && apt install postgresql-client-16 -y WORKDIR /opt/sources/ RUN apt-get install -y --no-install-recommends $(grep -v '^#' apt-requirements) -RUN curl -sL https://deb.nodesource.com/setup_lts.x | bash - && \ - apt-get install -y nodejs && \ - curl -L https://www.npmjs.com/install.sh | sh && \ - npm install -g less && npm cache clean --force +RUN apt-get clean && apt-get update && apt-get install -y locales RUN locale-gen en_US en_US.UTF-8 pt_BR pt_BR.UTF-8 && \ dpkg-reconfigure locales ENV LC_ALL pt_BR.UTF-8 -ADD conf/brasil-requirements /opt/sources/ RUN pip3 install setuptools && pip3 install --no-cache-dir --upgrade pip -RUN pip3 install --no-cache-dir -r pip-requirements && \ - pip3 install --no-cache-dir -r brasil-requirements -ADD https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.bionic_amd64.deb /opt/sources/wkhtmltox.deb -RUN dpkg -i wkhtmltox.deb && rm wkhtmltox.deb +RUN wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2_amd64.deb +RUN dpkg -i libssl1.1_1.1.1f-1ubuntu2_amd64.deb -RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - -RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ bionic"-pgdg main | tee /etc/apt/sources.list.d/pgdg.list -RUN apt-get update && apt-get install -y postgresql-client-11 +ADD https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.bionic_amd64.deb /opt/sources/wkhtmltox.deb +RUN dpkg -i wkhtmltox.deb && rm wkhtmltox.deb RUN mkdir /opt/odoo/ WORKDIR /opt/odoo/ RUN mkdir private - ##### Configurações Odoo ##### +##### Configurações Odoo ##### ADD conf/supervisord.conf /etc/supervisor/supervisord.conf @@ -58,11 +54,7 @@ RUN mkdir /var/log/odoo && \ chown -R odoo:odoo /var/log/odoo && \ chown odoo:odoo /var/run/odoo.pid - ##### Limpeza da Instalação ##### - -RUN apt-get autoremove -y && \ - apt-get autoclean - - ##### Finalização do Container ##### +##### Finalização do Container ##### WORKDIR /opt/odoo + diff --git a/README.md b/README.md index ce14568..0a9e95f 100644 --- a/README.md +++ b/README.md @@ -1,3 +1 @@ # docker-odoo-base - -[![Docker Repository on Quay](https://quay.io/repository/danimaribeiro/docker-odoo-base/status "Docker Repository on Quay")](https://quay.io/repository/danimaribeiro/docker-odoo-base) diff --git a/conf/apt-requirements b/conf/apt-requirements index 6ed3621..a5b6b41 100755 --- a/conf/apt-requirements +++ b/conf/apt-requirements @@ -1,48 +1,72 @@ -##### Dependências Odoo ##### -libxml2-dev -libxslt1-dev -libevent-dev -libsasl2-dev -libldap2-dev -libpq-dev -libjpeg-dev -libtiff5-dev -libjpeg8-dev -libopenjp2-7-dev -zlib1g-dev -libfreetype6-dev -liblcms2-dev -libwebp-dev -libharfbuzz-dev -libfribidi-dev -libxcb1-dev - -# Ferramentas -gcc -g++ -python3-pip +adduser +dh-python +packaging-dev +fonts-dejavu-core +fonts-freefont-ttf +fonts-freefont-otf +fonts-noto-core +fonts-inconsolata +fonts-font-awesome +fonts-roboto-unhinted +gsfonts +libjs-underscore +lsb-base python3-dev -locales -supervisor -curl -unzip -git +python3-gevent +python3-serial +python3-setuptools +python3-usb +python3-babel +python3-chardet +python3-dateutil +python3-decorator +python3-docutils +python3-freezegun +python3-geoip2 +python3-pil +python3-jinja2 +python3-libsass +python3-lxml +python3-num2words +python3-ofxparse +python3-passlib +python3-polib +python3-psutil +python3-psycopg2 +python3-pydot +python3-openssl +python3-pypdf2 +python3-rjsmin +python3-qrcode +python3-renderpm +python3-reportlab +python3-requests +python3-stdnum +python3-tz +python3-vobject +python3-werkzeug +python3-xlsxwriter +python3-xlrd +python3-zeep +python3-pip +xfonts-75dpi +xfonts-base wget -gettext-base -openssh-client -postgresql-client - -##### Dependências da Localização Brasileira ##### -libssl-dev +gnupg2 +build-essential +libldap2-dev +libsasl2-dev +slapd +ldap-utils +tox +lcov +valgrind +zip +unzip +pkg-config +libxml2-dev libxmlsec1-dev -python-openssl -python-cffi - - -##### Dependências do WKHTMLTOX ##### -fontconfig -libx11-6 -libxext6 -libxrender1 -xfonts-base -xfonts-75dpi +libxmlsec1-openssl +gettext-base +supervisor +rsync diff --git a/conf/brasil-requirements b/conf/brasil-requirements deleted file mode 100644 index d6751cc..0000000 --- a/conf/brasil-requirements +++ /dev/null @@ -1,15 +0,0 @@ -# odoo-brasil -suds-jurko-requests -xmlsec - -# trustcode-addons -urllib3==1.22 -pyopenssl==20.0.1 -iugu-trustcode - -# Atualizacao -click-odoo-contrib - -# Sentry -sentry-sdk -raven diff --git a/conf/pip-requirements b/conf/pip-requirements deleted file mode 100755 index f9c0877..0000000 --- a/conf/pip-requirements +++ /dev/null @@ -1,50 +0,0 @@ -Babel==2.9.1 # min version = 2.6.0 (Focal with security backports) -chardet==3.0.4 -cryptography==2.6.1 # incompatibility between pyopenssl 19.0.0 and cryptography>=37.0.0 -decorator==4.4.2 -docutils==0.16 -ebaysdk==2.1.5 -freezegun==0.3.11; python_version < '3.8' -freezegun==0.3.15; python_version >= '3.8' -gevent==1.5.0 ; python_version == '3.7' -gevent==20.9.0 ; python_version > '3.7' and python_version <= '3.9' -gevent==21.8.0 ; python_version > '3.9' # (Jammy) -greenlet==0.4.15 ; python_version == '3.7' -greenlet==0.4.17 ; python_version > '3.7' and python_version <= '3.9' -greenlet==1.1.2 ; python_version > '3.9' # (Jammy) -idna==2.8 -Jinja2==2.11.3 # min version = 2.10.1 (Focal - with security backports) -libsass==0.18.0 -lxml==4.6.5 # min version = 4.5.0 (Focal - with security backports) -MarkupSafe==1.1.0 -num2words==0.5.6 -ofxparse==0.19; python_version <= '3.9' -ofxparse==0.21; python_version > '3.9' # (Jammy) -passlib==1.7.3 # min version = 1.7.2 (Focal with security backports) -Pillow==9.0.1 # min version = 7.0.0 (Focal with security backports) -polib==1.1.0 -psutil==5.6.7 # min version = 5.5.1 (Focal with security backports) -psycopg2==2.7.7; sys_platform != 'win32' and python_version < '3.8' -psycopg2==2.8.6; sys_platform == 'win32' or python_version >= '3.8' -pydot==1.4.1 -pyopenssl==19.0.0 -PyPDF2==1.26.0 -pypiwin32 ; sys_platform == 'win32' -pyserial==3.4 -python-dateutil==2.7.3 -python-ldap==3.4.0 ; sys_platform != 'win32' # min version = 3.2.0 (Focal with security backports) -python-stdnum==1.13 -pytz==2019.3 -pyusb==1.0.2 -qrcode==6.1 -reportlab==3.5.59 # version < 3.5.54 are not compatible with Pillow 8.1.2 and 3.5.59 is bullseye -requests==2.25.1 # versions < 2.25 aren't compatible w/ urllib3 1.26. Bullseye = 2.25.1. min version = 2.22.0 (Focal) -urllib3==1.26.5 # indirect / min version = 1.25.8 (Focal with security backports) -vobject==0.9.6.1 -Werkzeug==0.16.1 ; python_version <= '3.9' -Werkzeug==2.0.2 ; python_version > '3.9' # (Jammy) -xlrd==1.1.0; python_version < '3.8' -xlrd==1.2.0; python_version >= '3.8' -XlsxWriter==1.1.2 -xlwt==1.3.* -zeep==3.4.0 \ No newline at end of file diff --git a/conf/supervisord.conf b/conf/supervisord.conf index 2777963..292fedb 100755 --- a/conf/supervisord.conf +++ b/conf/supervisord.conf @@ -6,7 +6,7 @@ loglevel=error ; info, debug, warn, trace file=/tmp/supervisor.sock ; (the path to the socket file) [program:odoo] -command=/usr/bin/odoo-server --config=/etc/odoo/odoo.conf --db_host=%(ENV_PG_HOST)s --db_port=%(ENV_PG_PORT)s --db_user=%(ENV_PG_USER)s --db_password=%(ENV_PG_PASSWORD)s --xmlrpc-port=%(ENV_PORT)s --longpolling-port=%(ENV_LONGPOLLING_PORT)s --workers=%(ENV_WORKERS)s +command=/usr/bin/odoo-server --config=/etc/odoo/odoo.conf --db_host=%(ENV_PG_HOST)s --db_port=%(ENV_PG_PORT)s --db_user=%(ENV_PG_USER)s --db_password=%(ENV_PG_PASSWORD)s --xmlrpc-port=%(ENV_PORT)s --gevent-port=%(ENV_GEVENT_PORT)s --workers=%(ENV_WORKERS)s %(ENV_EXTRA_ARGS)s stdout_logfile=/var/log/odoo/odoo.log user=odoo autorestart=true