- git rm --cached odoo: Gitlink-Eintrag entfernt, odoo/ wird jetzt korrekt versioniert - odoo/src/odoo-dev.conf: db_name = odoo gesetzt (behebt 404 bei mehreren DBs) - docs/FEATURE_REQUEST_DYNAMIC_PARSER_REGISTRY.md: Feature Request inkl. ADR - docs/IMPLEMENTATION_PLAN_DYNAMIC_PARSER_REGISTRY.md: 3-Phasen-Implementierungsplan - iot_bridge/README.md: Doku aktualisiert
182 lines
6.2 KiB
Docker
182 lines
6.2 KiB
Docker
# Development Dockerfile für Odoo mit Visual Studio Code Debug-Support
|
|
# Basiert auf dem originalen Dockerfile mit Entwicklungs-Erweiterungen
|
|
|
|
FROM ubuntu:noble
|
|
|
|
SHELL ["/bin/bash", "-xo", "pipefail", "-c"]
|
|
|
|
# Generate locale C.UTF-8 for postgres and general locale data
|
|
ENV LANG=en_US.UTF-8
|
|
|
|
# Retrieve the target architecture to install the correct wkhtmltopdf package
|
|
ARG TARGETARCH
|
|
|
|
# Install deps + development tools for VS Code debugging
|
|
RUN apt-get update && \
|
|
DEBIAN_FRONTEND=noninteractive \
|
|
apt-get install -y --no-install-recommends \
|
|
ca-certificates \
|
|
curl \
|
|
dirmngr \
|
|
fonts-noto-cjk \
|
|
gnupg \
|
|
libssl-dev \
|
|
node-less \
|
|
npm \
|
|
python3-magic \
|
|
python3-num2words \
|
|
python3-odf \
|
|
python3-pdfminer \
|
|
python3-pip \
|
|
python3-phonenumbers \
|
|
python3-psycopg2 \
|
|
python3-pyldap \
|
|
python3-qrcode \
|
|
python3-renderpm \
|
|
python3-setuptools \
|
|
python3-slugify \
|
|
python3-vobject \
|
|
python3-watchdog \
|
|
python3-xlrd \
|
|
python3-xlwt \
|
|
xz-utils \
|
|
git \
|
|
patch \
|
|
# Entwicklungstools hinzufügen
|
|
python3-dev \
|
|
python3-venv \
|
|
build-essential \
|
|
vim \
|
|
nano \
|
|
htop \
|
|
tree \
|
|
wget \
|
|
unzip \
|
|
ssh \
|
|
rsync && \
|
|
if [ -z "${TARGETARCH}" ]; then \
|
|
TARGETARCH="$(dpkg --print-architecture)"; \
|
|
fi; \
|
|
WKHTMLTOPDF_ARCH=${TARGETARCH} && \
|
|
case ${TARGETARCH} in \
|
|
"amd64") WKHTMLTOPDF_ARCH=amd64 && WKHTMLTOPDF_SHA=967390a759707337b46d1c02452e2bb6b2dc6d59 ;; \
|
|
"arm64") WKHTMLTOPDF_SHA=90f6e69896d51ef77339d3f3a20f8582bdf496cc ;; \
|
|
"ppc64le" | "ppc64el") WKHTMLTOPDF_ARCH=ppc64el && WKHTMLTOPDF_SHA=5312d7d34a25b321282929df82e3574319aed25c ;; \
|
|
esac \
|
|
&& curl -o wkhtmltox.deb -sSL https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-3/wkhtmltox_0.12.6.1-3.jammy_${WKHTMLTOPDF_ARCH}.deb \
|
|
&& echo ${WKHTMLTOPDF_SHA} wkhtmltox.deb | sha1sum -c - \
|
|
&& apt-get install -y --no-install-recommends ./wkhtmltox.deb \
|
|
&& rm -rf /var/lib/apt/lists/* wkhtmltox.deb
|
|
|
|
# install latest postgresql-client
|
|
RUN echo 'deb http://apt.postgresql.org/pub/repos/apt/ noble-pgdg main' > /etc/apt/sources.list.d/pgdg.list \
|
|
&& curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | gpg --dearmor -o /etc/apt/trusted.gpg.d/postgresql.gpg \
|
|
&& 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 Python debugging and development tools via apt (where available)
|
|
RUN apt-get update && \
|
|
DEBIAN_FRONTEND=noninteractive \
|
|
apt-get install -y --no-install-recommends \
|
|
python3-autopep8 \
|
|
python3-full \
|
|
pipx && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
# Install Python debugging tools that are not available via apt
|
|
# Using --break-system-packages for tools needed in container environment
|
|
RUN pip3 install --no-cache-dir --break-system-packages \
|
|
debugpy \
|
|
ipdb \
|
|
pylint \
|
|
dokuwiki \
|
|
paho-mqtt
|
|
|
|
# Install Odoo
|
|
ENV ODOO_VERSION=18.0
|
|
ARG ODOO_RELEASE=20251226
|
|
ARG ODOO_SHA=9bddc7016d0b67bd1743a2209b8d926a974b25fa
|
|
RUN curl -o odoo.deb -sSL http://nightly.odoo.com/${ODOO_VERSION}/nightly/deb/odoo_${ODOO_VERSION}.${ODOO_RELEASE}_all.deb \
|
|
&& echo "${ODOO_SHA} odoo.deb" | sha1sum -c - \
|
|
&& apt-get update \
|
|
&& apt-get -y install --no-install-recommends ./odoo.deb \
|
|
&& rm -rf /var/lib/apt/lists/* odoo.deb
|
|
|
|
# Copy entrypoint script and Odoo configuration file
|
|
COPY ./src/entrypoint.sh /
|
|
COPY ./src/odoo.conf /etc/odoo/
|
|
|
|
# Apply Odoo bugfixes
|
|
COPY ./src/fix-pos-session-start-at.patch /tmp/
|
|
COPY ./src/fix-pos-closing-reload.patch /tmp/
|
|
RUN patch -p1 -d / < /tmp/fix-pos-session-start-at.patch && \
|
|
patch -p1 -d / < /tmp/fix-pos-closing-reload.patch && \
|
|
rm /tmp/*.patch
|
|
|
|
# Erstelle Development-spezifische Konfiguration
|
|
COPY ./src/odoo.conf /etc/odoo/odoo-dev.conf
|
|
|
|
# Set permissions and Mount directories
|
|
RUN chown odoo /etc/odoo/odoo.conf \
|
|
&& chown odoo /etc/odoo/odoo-dev.conf \
|
|
&& mkdir -p /var/lib/odoo \
|
|
&& chown -R odoo /var/lib/odoo \
|
|
&& mkdir -p /mnt/extra-addons \
|
|
&& chown -R odoo /mnt/extra-addons
|
|
|
|
|
|
|
|
# Volumes für Development
|
|
VOLUME ["/var/lib/odoo", "/mnt/extra-addons"]
|
|
|
|
# Expose Odoo services + Debug Port
|
|
EXPOSE 8069 8071 8072 5678
|
|
|
|
# Set the default config file für Development
|
|
ENV ODOO_RC=/etc/odoo/odoo-dev.conf
|
|
ENV PYTHONPATH=/mnt/extra-addons
|
|
|
|
COPY ./src/wait-for-psql.py /usr/local/bin/wait-for-psql.py
|
|
|
|
# Erstelle ein Development-spezifisches Entrypoint-Script
|
|
COPY ./src/entrypoint-dev.sh /entrypoint-dev.sh
|
|
RUN chmod +x /entrypoint-dev.sh
|
|
|
|
# Set default user when running the container
|
|
|
|
ARG ODOO_UID=100
|
|
ARG ODOO_GID=101
|
|
|
|
# Ensure odoo user/group have the requested UID/GID and fix ownership of important dirs
|
|
RUN set -eux; \
|
|
# create group if missing, or change GID
|
|
if ! getent group odoo >/dev/null; then groupadd -r -g "${ODOO_GID}" odoo || true; else groupmod -g "${ODOO_GID}" odoo || true; fi; \
|
|
# create user if missing, or change UID and primary group
|
|
if ! id -u odoo >/dev/null 2>&1; then useradd -r -u "${ODOO_UID}" -g "${ODOO_GID}" -d /var/lib/odoo -s /bin/bash odoo || true; else usermod -u "${ODOO_UID}" -g "${ODOO_GID}" odoo || true; fi; \
|
|
# fix ownership of the standard odoo dirs in the image
|
|
chown -R "${ODOO_UID}":"${ODOO_GID}" /var/lib/odoo /mnt/extra-addons /opt/odoo || true
|
|
|
|
# Create /run/sshd and ensure the odoo user can write into it so VS Code Server
|
|
# installation (which may run commands as the odoo UID) can create needed dirs.
|
|
RUN mkdir -p /run/sshd \
|
|
&& chown -R "${ODOO_UID}":"${ODOO_GID}" /run/sshd || true
|
|
|
|
# Git-Konfiguration für Development (als odoo ausführen, damit Dateien in /var/lib/odoo korrekt erstellt werden)
|
|
RUN git config --global user.name 'matthias.lotz' && \
|
|
git config --global user.email 'matthias.lotz@hobbyhimmel.de' && \
|
|
git config --global init.defaultBranch main
|
|
|
|
USER odoo
|
|
|
|
|
|
|
|
# Arbeitsverzeichnis für Development
|
|
WORKDIR /mnt/extra-addons
|
|
|
|
ENTRYPOINT ["/entrypoint-dev.sh"]
|
|
CMD ["odoo"] |