Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM python:3.10-slim AS builder

WORKDIR /install

COPY requirements.txt .

RUN apt-get update && apt-get install -y --no-install-recommends \
python3-pip \
&& rm -rf /var/lib/apt/lists/*

RUN pip3 install --no-cache-dir --target=/opt/extra-python/libs \
"logfire>=4.16.0"

FROM odoo:17

USER root

COPY --from=builder /opt/extra-python/libs /opt/extra-python/libs
ENV PYTHONPATH="/opt/extra-python/libs:/usr/lib/python3/dist-packages"

COPY ./custom_addons /mnt/extra-addons

RUN chown -R odoo:odoo /mnt/extra-addons /opt/extra-python/libs

USER odoo

ENTRYPOINT ["/usr/bin/odoo"]
CMD ["--addons-path=/usr/lib/python3/dist-packages/odoo/addons,/mnt/extra-addons","--db_host=db","--db_user=odoo","--db_password=odoo"]
10 changes: 3 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3.1'

services:
db:
image: postgres:15
Expand All @@ -11,7 +9,7 @@ services:
- odoo-db-data:/var/lib/postgresql/data

odoo:
image: odoo:17
build: .
depends_on:
- db
ports:
Expand All @@ -20,10 +18,8 @@ services:
- HOST=db
- USER=odoo
- PASSWORD=odoo
volumes:
- odoo-web-data:/var/lib/odoo
- ./custom_addons:/mnt/extra-addons
env_file:
- .env

volumes:
odoo-db-data:
odoo-web-data:
Loading