Kita akan menginstal Odoo 17 CE pada Docker pada seting di mana kita mudah melakukan upload. Pada instalasi ini kita akan menempatkan Addons dan Config pada suatu folder dalam home directory.
Instalasi Odoo 17 Community Edition pada Docker untuk pengembangan aplikasi adalah seperti pada langkah-langkah berikut ini
- Membuat user khusus
# adduser apku info: Adding user `apku' ... info: Selecting UID/GID from range 1000 to 59999 ... info: Adding new group `apku' (1001) ... info: Adding new user `apku' (1001) with group `apku (1001)' ... info: Creating home directory `/home/apku' ... info: Copying files from `/etc/skel' ... New password: Retype new password: passwd: password updated successfully Changing the user information for apku Enter the new value, or press ENTER for the default Full Name []: Room Number []: Work Phone []: Home Phone []: Other []: Is the information correct? [Y/n] info: Adding new user `apku' to supplemental / extra groups `users' ... info: Adding user `apku' to group `users' ...
- Membuat folder odooku
apku@odoo17:~$ mkdir odooku
- Menjalankan docker compose
root@odoo17:/home/apku/odooku# cat docker-compose.yml version: '3.1' services: web: image: odoo:17.0 depends_on: - db ports: - "9070:8069" volumes: - odoo-web-data:/var/lib/odoo - ./config:/etc/odoo - ./addons:/mnt/extra-addons environment: - PASSWORD_FILE=/run/secrets/postgresql_password secrets: - postgresql_password db: image: postgres:15 environment: - POSTGRES_DB=postgres - POSTGRES_PASSWORD_FILE=/run/secrets/postgresql_password - POSTGRES_USER=odoo - PGDATA=/var/lib/postgresql/data/pgdata volumes: - ./data-db:/var/lib/postgresql/data/pgdata secrets: - postgresql_password secrets: postgresql_password: file: odoo_pg_pass volumes: odoo-web-data: root@odoo17:/home/apku/odooku# ls docker-compose.yml odoo_pg_pass root@odoo17:/home/apku/odooku# docker-compose up -d # chown -R apku addons root@odoo17:/home/apku/odooku# cat odoo_pg_pass
- Alternatif docker compose jika mau akses langsung ke database PostgeSQL
# cat docker-compose.yml version: '3.1' services: web: image: odoo:17 depends_on: - db ports: - "9060:8069" volumes: - odoo-web-data:/var/lib/odoo - ./config:/etc/odoo - ./addons:/mnt/extra-addons environment: - PASSWORD_FILE=/run/secrets/postgresql_password secrets: - postgresql_password db: image: postgres:15 ports: - "15001:5432" environment: - POSTGRES_DB=postgres - POSTGRES_PASSWORD_FILE=/run/secrets/postgresql_password - POSTGRES_USER=odoo - PGDATA=/var/lib/postgresql/data/pgdata volumes: - ./data-db:/var/lib/postgresql/data/pgdata secrets: - postgresql_password secrets: postgresql_password: file: odoo_pg_pass volumes: odoo-web-data: root@odoo-litepro:/home/apku/odoo17# psql -h 127.0.0.1 -p 15001 -U odoo -d rnd17000.tima.id Password for user odoo: psql (14.15 (Ubuntu 14.15-0ubuntu0.22.04.1), server 15.8 (Debian 15.8-1.pgdg120+1)) WARNING: psql major version 14, server major version 15. Some psql features might not work. Type "help" for help. rnd17000.tima.id=#
- Mengedit Odoo Configuration
# pwd /home/apku/odooku/config # ls -al total 12 drwxr-xr-x 2 root root 4096 May 25 00:50 . drwxrwxr-x 5 apku apku 4096 May 25 00:24 .. -rw-rwxr-- 1 messagebus root 231 May 25 01:11 odoo.conf root@odoo17:/home/apku/odooku/config# cat odoo.conf [options] addons_path = /mnt/extra-addons data_dir = /var/lib/odoo dbfilter = ^%h$ logfile = /var/log/odoo/odoo-server.log log_level = info
Catatan: saat konfigurasi file odoo.conf memerlukan chmod a+rw odoo.conf supaya password global bisa disimpan
- Supaya container selalu start saat reboot
# docker update --restart=always odooku-web-1 # docker update --restart=always odooku-db-1
- Membaca log Odoo
# docker exec -ti odooku-web-1 bash odoo@6a6762d3c4d3:/$ cat /var/log/odoo/odoo-server.log
- Authentication dengan password
Jika VPS tidak bisa melakukan authentication dengan password silahkan mengunjungi https://kb.biznetgio.com/id_ID/informasi/cara-allow-password-authentication-pada-ubuntu-2204 ,
Artikel berkaitan dengan instalasi Odoo 17 CE pada Docker silahkan mengunjungi https://www.proweb.co.id/implementasi-odoo/odoo17-ce/instalasi-ubuntu-24/ .
Kunjungi www.proweb.co.id/implementasi-odoo/ untuk menambah wawasan implementasi Odoo ERP.