Skip to Content
Menu
This question has been flagged
3 Replies
10259 Views

Hello Odoo friends,

I have a problem, I'm more of a Windows person and am now trying Linux, i.e. Docker.
I'm running Odoo16 on a Docker (Syno NAS). Now third party wants to install APPs.
I created a folder and everything else so far. I put the app that I wanted in there. I also mounted it, but it doesn't appear in Odoo so I can install it. Can someone please tell me how and where I have to do this so that I can put the APPs in a folder on the NAS and then install them in Odoo.

Thank you in advance

Avatar
Discard
Best Answer

I have a test server running on a Synology NAS. I use the following docker-compose.yml:

version: '3.8'

services:

postgres:
container_name: odoo-postgres
image: postgres:14.1-alpine
networks:
- web
ports:
- 5432:5432
environment:
POSTGRES_DB: postgres
POSTGRES_USER: odoo
POSTGRES_PASSWORD: secret
volumes:
- ./postgres-data:/var/lib/postgresql/data
restart: always

odoo:
container_name: odoo
image: odoo:15.0
networks:
- web
environment:
HOST: postgres
USER: odoo
PASSWORD: secret
depends_on:
- postgres
ports:
- 8069:8069
volumes:
- ./config:/etc/odoo
- ./extra-addons:/mnt/extra-addons
- ./data:/var/lib/odoo
restart: always
links:
- postgres

networks:
web:
external: true
name: web

Please make sure that you have configured /config/odoo.conf correctly and included your module in the addons_path:

[options]
addons_path = /usr/lib/python3/dist-packages/odoo/addons, /mnt/extra-addons
...

In Odoo you also have to 'Update App List' in the Apps module. This item is visible when you activate the developer mode under 'Settings'. For more information, you can also check out my blog post: https://jortdevreeze.com/blog/odoo-2/dock-stack-launch-odoo-deployment-with-docker-and-portainer-4

I hope this helps!

Avatar
Discard
Best Answer

I've been using Odoo on Docker with Synology NAS for a while.
If you are using it behind the Synology reverse proxy (NGINX) for LetsEncrypt, I always follow the script below to lock it down further for better performance and security.

Synology Tweaks:
1. Login via SSH
2. Go to /usr/syno/share/nginx, make a backup copy of both gzip.mustache and HSTS.mustache
3. Edit gzip - Add the following lines to the bottom:
gzip_types text/css text/less text/plain text/xml application/xml application/json application/javascript;
gzip on;
4. Edit HSTS.mustache - Add the following:
add_header Strict-Transport-Security "max-age=15768000; includeSubdomains; preload" always;
add_header X-Frame-Options SAMEORIGIN;
add_header X-Content-Type-Options nosniff;
add_header Referrer-Policy "strict-origin";
add_header X-XSS-Protection "1; mode=block";
add_header 'Content-Security-Policy' 'upgrade-insecure-requests';
5. Run nginx -t, systemctl reload nginx, then systemctl restart nginx
6. Test via Gtmetrix, SSLTest and securityheaders.com

Avatar
Discard
Author Best Answer

Ok that helps me, but that will be my problem, that the module is not correct in the odoo.conf. My problem, I just realized that I can't find / open it. I also looked at your blog. You install the Odoo via stack and I simply installed it via New Container. That's probably why I wasn't able to store the data correctly there.


Avatar
Discard

You need to make the /etc/odoo, /mnt/extra-addons, and /var/lib/odoo folders persistent (i.e., use volumes). What you could do is ssh into your NAS and in you odoo folder add the docker-compose.yml file:

$ echo "" > docker-compose.yml

And then create the folders as specified in the docker-compose.yml file below:

$ mkdir config
$ mkdir extra-addons
$ mkdir data

And then build and run your containers:

$ sudo docker-compose up -d --build

Now these directories will contain the data you need. Alternatively, is that you create volumes and use these (e.g., docker volume create volume_name) and use these. These folders can be found in my Synology NAS under: '/volume1/@docker/volumes/volume_name'