Skip to content

Commit

Permalink
[fix] revert to the latest stable version
Browse files Browse the repository at this point in the history
  • Loading branch information
mostafabarmshory committed Oct 1, 2023
1 parent 36484fc commit fa00292
Showing 1 changed file with 56 additions and 62 deletions.
118 changes: 56 additions & 62 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
FROM ubuntu:22.04
FROM debian:bullseye-slim

SHELL ["/bin/bash", "-xo", "pipefail", "-c"]


# Install some deps, lessc and less-plugin-clean-css, and wkhtmltopdf
ARG DEBIAN_FRONTEND=noninteractive
ENV TZ=Etc/UTC
# Generate locale C.UTF-8 for postgres and general locale data
ENV LANG C.UTF-8
ENV ODOO_VERSION 16.0
ENV ODOO_RC /etc/odoo/odoo.conf

# Install some deps, lessc and less-plugin-clean-css, and wkhtmltopdf
RUN apt-get update && \
apt-get install --no-install-recommends -y \
ca-certificates \
Expand All @@ -20,19 +16,6 @@ RUN apt-get update && \
libssl-dev \
node-less \
npm \
xz-utils \
adduser \
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 \
wkhtmltopdf \
python3-num2words \
python3-pdfminer \
python3-pip \
Expand All @@ -46,6 +29,46 @@ RUN apt-get update && \
python3-watchdog \
python3-xlrd \
python3-xlwt \
xz-utils \
&& curl -o wkhtmltox.deb -sSL https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.buster_amd64.deb \
&& echo 'ea8277df4297afc507c61122f3c349af142f31e5 wkhtmltox.deb' | sha1sum -c - \
&& apt-get install --no-install-recommends -y ./wkhtmltox.deb \
&& rm -rf /var/lib/apt/lists/* wkhtmltox.deb

# install latest postgresql-client
RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main' > /etc/apt/sources.list.d/pgdg.list \
&& GNUPGHOME="$(mktemp -d)" \
&& export GNUPGHOME \
&& repokey='B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8' \
&& gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "${repokey}" \
&& gpg --batch --armor --export "${repokey}" > /etc/apt/trusted.gpg.d/pgdg.gpg.asc \
&& gpgconf --kill all \
&& rm -rf "$GNUPGHOME" \
&& apt-get update \
&& apt-get install --no-install-recommends -y postgresql-client \
&& rm -f /etc/apt/sources.list.d/pgdg.list \
&& rm -rf /var/lib/apt/lists/*

# Install rtlcss (on Debian buster)
RUN npm install -g rtlcss

# Install Odoo
ENV ODOO_VERSION 16.0
ARG ODOO_RELEASE=20230109
ARG ODOO_SHA=884bf72c7318835b9ac56be2594032cbba7b8c7b
RUN apt-get update \
&& apt-get install --no-install-recommends -y \
adduser \
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 \
postgresql-client \
python3-babel \
python3-chardet \
Expand All @@ -71,7 +94,7 @@ RUN apt-get update && \
python3-reportlab \
python3-requests \
python3-stdnum \
python3-tz \
# python3-tz \
python3-vobject \
python3-werkzeug \
python3-xlsxwriter \
Expand All @@ -82,63 +105,34 @@ RUN apt-get update && \
&& pip install \
openupgradelib \
jdatetime \
persiantools \
&& pip cache purge \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /var/logs/*

# install latest wkhtmltopdf
RUN apt-get update && \
apt-get install --no-install-recommends -y wkhtmltopdf \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /var/logs/*
# RUN curl -o wkhtmltox.deb -sSL https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-2/wkhtmltox_0.12.6.1-2.jammy_amd64.deb \
# && echo '800eb1c699d07238fee77bf9df1556964f00ffcf wkhtmltox.deb' | sha1sum -c - \
# && apt-get install --no-install-recommends -y xfonts-base ./wkhtmltox.deb \
# && rm -rf wkhtmltox.deb \
# && rm -rf /var/lib/apt/lists/* \
# && rm -rf /var/logs/*

# install latest postgresql-client
# RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main' > /etc/apt/sources.list.d/pgdg.list \
# && GNUPGHOME="$(mktemp -d)" \
# && export GNUPGHOME \
# && repokey='B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8' \
# && gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "${repokey}" \
# && gpg --batch --armor --export "${repokey}" > /etc/apt/trusted.gpg.d/pgdg.gpg.asc \
# && gpgconf --kill all \
# && rm -rf "$GNUPGHOME" \
# && apt-get update \
# && apt-get install --no-install-recommends -y postgresql-client \
# && rm -f /etc/apt/sources.list.d/pgdg.list \
# && rm -rf /var/lib/apt/lists/* \
# && rm -rf /var/logs/*

# Install rtlcss (on Debian buster)
RUN npm install -g rtlcss \
&& npm cache clean --force \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /tmp/*
pytz \
&& rm -rf \
/var/lib/apt/lists/*

# Copy entrypoint script and Odoo configuration file
COPY ./entrypoint.sh /
COPY ./odoo.conf /etc/odoo/

# Set permissions and Mount /var/lib/odoo to allow restoring filestore and /mnt/extra-addons for users addons
RUN adduser --system \
--home /var/lib/odoo \
--quiet --group odoo \
&& chown odoo:odoo /var/lib/odoo \
&& chown odoo /etc/odoo/odoo.conf \
# && chown odoo:odoo /var/lib/odoo \
# && chown odoo /etc/odoo/odoo.conf \
&& mkdir -p /mnt/extra-addons \
&& chown -R odoo /mnt/extra-addons
# && chown -R odoo /mnt/extra-addons
VOLUME ["/var/lib/odoo", "/mnt/extra-addons"]

# Expose Odoo services
EXPOSE 8069 8071 8072

# Set the default config file
ENV ODOO_RC /etc/odoo/odoo.conf

COPY wait-for-psql.py /usr/local/bin/wait-for-psql.py

# Set default user when running the container
# USER odoo

ENTRYPOINT ["/entrypoint.sh"]
CMD ["odoo"]
CMD ["odoo"]

0 comments on commit fa00292

Please sign in to comment.