Skip to content

Instantly share code, notes, and snippets.

@3mrdev
Created August 5, 2025 18:42
Show Gist options
  • Select an option

  • Save 3mrdev/da305aa2027aa95da326395dd51e246c to your computer and use it in GitHub Desktop.

Select an option

Save 3mrdev/da305aa2027aa95da326395dd51e246c to your computer and use it in GitHub Desktop.
Odoo 18 Docker Compose file

Custom Odoo docker compose file

This is a simple docker compose file built by Amr for faster building of odoo instances i hope its useful for someone good luck.

Steps to Setup the docker containers from a docker compose file

  • Create a folder anywhere in your computer and name it ex. "odoo18".
  • Open the "odoo18" Folder.
  • Create file named odoo_pg_pass in the "odoo18" folder and put the password for odoo and postgres inside it.
  • Create .env file from the sample in the "odoo18" folder. (It will be hidden when you create it so just unhide)
  • Open the terminal in the "odoo18" folder.
  • Run this command in the terminal "docker compose up -d" to create and run the continers.
  • 2 Folders will be created automaticly
    • "custom_addons" you can put your custom addons or enterprise addons in this folder
    • "config" you can put your custom odoo.conf file in this folder

Steps to update the docker continers

  • Run this command in terminal "docker compose down" to remove the continers after you make updates to the yaml
  • Run this command in terminal "docker compose up -d" to create and run the containers

To auto upgrade your module

  • Uncomment the "command" line in the yaml file in line 4 and replace the database_name with the database you are using and the right the module_name you want to upgrade with every restart of the odoo container
services:
web:
image: odoo:18.0
#command: --dev=reload -d database_name -u module_to_upgrade
env_file: .env
depends_on:
- db
ports:
- "8018:8069"
volumes:
- odoo-web-data:/var/lib/odoo
- ./config:/etc/odoo
- ./custom_addons:/mnt/extra-addons
secrets:
- postgresql_password
db:
image: postgres:15
env_file: .env
volumes:
- odoo-db-data:/var/lib/postgresql/data/pgdata
secrets:
- postgresql_password
volumes:
odoo-web-data:
odoo-db-data:
secrets:
postgresql_password:
file: odoo_pg_pass
[options]
addons_path = /mnt/extra-addons
data_dir = /var/lib/odoo
; admin_passwd = admin
; csv_internal_sep = ,
; db_maxconn = 64
; db_name = False
; db_template = template1
; dbfilter = .*
; debug_mode = False
; email_from = False
; limit_memory_hard = 2684354560
; limit_memory_soft = 2147483648
; limit_request = 8192
; limit_time_cpu = 60
; limit_time_real = 120
; list_db = True
; log_db = False
; log_handler = [':INFO']
; log_level = info
; logfile = None
; longpolling_port = 8072
; max_cron_threads = 2
; osv_memory_age_limit = 1.0
; osv_memory_count_limit = False
; smtp_password = False
; smtp_port = 25
; smtp_server = localhost
; smtp_ssl = False
; smtp_user = False
; workers = 0
; xmlrpc = True
; xmlrpc_interface =
; xmlrpc_port = 8069
; xmlrpcs = True
; xmlrpcs_interface =
; xmlrpcs_port = 8071
# postgresql environment variables
POSTGRES_DB=postgres
POSTGRES_PASSWORD_FILE=/run/secrets/postgresql_password
POSTGRES_USER=odoo
PGDATA=/var/lib/postgresql/data/pgdata
# odoo environment variables
PASSWORD_FILE=/run/secrets/postgresql_password
ODOO_ADDONS_PATH=/mnt/extra-addons
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment