Skip to content

Instantly share code, notes, and snippets.

@arisnew
Last active April 28, 2026 01:40
Show Gist options
  • Select an option

  • Save arisnew/6538e2a36ab8ddb80228346579caa54e to your computer and use it in GitHub Desktop.

Select an option

Save arisnew/6538e2a36ab8ddb80228346579caa54e to your computer and use it in GitHub Desktop.
Install odoo 18 + py3o + libreoffice dengan docker compose (tanpa create custom image)

Contoh Docker Compose Odoo 18 + py3o + libreoffice

services:
  db:
    image: postgres:15
    environment:
      - POSTGRES_USER=odoo
      - POSTGRES_PASSWORD=odoo
      - POSTGRES_DB=postgres
      - PGDATA=/var/lib/postgresql/data/pgdata
    volumes:
      - db-data:/var/lib/postgresql/data
    ports:
      - "5418:5432"

  odoo:
    image: odoo:18.0
    user: root
    volumes:
      - ./addons-enterprise:/mnt/enterprise-addons
      - ./addons-extra:/mnt/extra-addons
      - ./config:/etc/odoo
      - odoo-data:/var/lib/odoo
      - extra-pip:/opt/extra-pip
      - apt-cache:/var/cache/apt/archives
      - ./requirements.extra.txt:/tmp/requirements.extra.txt:ro
    command: >
      bash -c "
      set -e;
      if ! command -v libreoffice >/dev/null 2>&1; then
        echo '>>> Installing LibreOffice (first run only)...';
        rm -f /etc/apt/apt.conf.d/docker-clean;
        echo 'Binary::apt::APT::Keep-Downloaded-Packages \"true\";' > /etc/apt/apt.conf.d/keep-cache;
        apt-get update;
        apt-get install -y --no-install-recommends libreoffice-core libreoffice-writer libreoffice-calc default-jre-headless fonts-dejavu fonts-liberation;
      else
        echo '>>> LibreOffice already installed, skipping.';
      fi;
      python3 -m pip install --target=/opt/extra-pip -r /tmp/requirements.extra.txt;
      chown -R odoo:odoo /opt/extra-pip /var/lib/odoo;
      exec su odoo -s /bin/bash -c 'exec /entrypoint.sh odoo'
      "
    ports:
      - "8088:8069"
    depends_on:
      - db
    environment:
      - HOST=db
      - USER=odoo
      - PASSWORD=odoo
      - PYTHONPATH=/opt/extra-pip
      - PATH=/opt/extra-pip/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
    stdin_open: true
    tty: true
  
volumes:
  odoo-data:
  db-data:
  extra-pip:
  apt-cache:

Berikut file requirements.extra.txt

py3o.template
py3o.formats
genshi
packaging
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment