Odoo + Traefik (replacing the Nginx reverse proxy)
The docker image wbsouza/odoo:11.0 contains everything to run Odoo (including the PostgreSQL). It's not recommended to run this image in production, it was build only for test purpose, to demonstrate a potential inconsistence using Traefik as a proxy for Odoo. Feel free to customize or make your own Odoo image, the source code of the image is available on https://github.com/wbsouza/odoo-docker.
*** The database is going to be re-created if you remove the file volumes/odoo/conf/.initialized
. ***
- Access your domain provider and add the following entries to your domain (
A
orCNAME
)
traefik.mycompany.io
odoo.mycompany.io
- Create a bridge network to be used by the containers
docker create network web
-
Copy the file .env.sample to .env and change the domain name and the email for the LetsEncript certificate
-
Execute
docker-compose up
-
Login with the default credentials (admin/admin)
-
Install the CRM module (or any other backend module)
-
Stop the odoo container
docker stop odoo
-
Change the configuration file
volumes/odoo/conf/odoo.conf
append the following parameters in the end of the file:
proxy_mode = True
workers = 4
-
Login again with the default credentials
-
Check the log files as well the browser looking for JavaScript errors, it should be working without any problem
- If you want create volumes like in the
odoo.conf.sample
file, make sure to give the right permissions or change the owner in the host filesystem volumes, because the container will run with an unprivileged user (odoo, UID=9100, GID=9100
).
chown -fR '9100:9100' volumes/odoo