How to do it...

To adapt the configuration file for production, you need to follow these steps:

  1. Create a new configuration file for production based on the development file:
$ cd ~/odoo-prod/project
$ cp development.conf production.conf
  1. Edit the production configuration file production.conf.
  2. Change the addons path to match the production base directory:
addons_path = /home/odoo/odoo-prod/project/src/odoo/addons,
/home/odoo/odoo-prod/project/src/odoo/odoo/addons,
/home/odoo/odoo-prod/project/src/partner-contact
  1. Change the data directory:
data_dir = /home/odoo/odoo-prod/project/filestore  
  1. Change the server log path to match the production base directory:
logfile = /home/odoo/odoo-prod/project/logs/odoo.log  
  1. Configure log rotation:
logrotate = True
  1. Configure the logging handlers:
log_level = warn
log_handler = :WARNING,werkzeug:CRITICAL,odoo.service.server:INFO
  1. Adapt the database connection parameters:
db_host = False
db_maxconn = 64
db_name = odoo-project
db_password = False
db_port = False
db_template = template1
db_user = False  
  1. Configure the database filter, and disable database listing:
dbfilter = odoo-project$
list_db = False
  1. Change the master password using a random password generated with pwgen :
admin_password = use a random password
  1. Configure Odoo to run with workers:
workers = 4
# limit_memory_hard: 4GB limit_memory_hard = 4294967296
# limit_memory_soft: 640MB limit_memory_soft = 671088640 limit_request = 8192 limit_time_cpu = 120 limit_time_real = 300
  1. Only listen on the local network interface:
http_interface = 127.0.0.1
  1. Save the file, and add it to the Git repository:
$ git add production.conf
$ git commit -m "add production configuration file"