{"id":13937812,"url":"https://github.com/camptocamp/docker-odoo-project","last_synced_at":"2025-07-20T00:31:09.585Z","repository":{"id":4821135,"uuid":"51378089","full_name":"camptocamp/docker-odoo-project","owner":"camptocamp","description":"Base images for Odoo projects","archived":false,"fork":false,"pushed_at":"2025-07-01T09:35:49.000Z","size":820,"stargazers_count":166,"open_issues_count":35,"forks_count":153,"subscribers_count":40,"default_branch":"master","last_synced_at":"2025-07-01T10:39:11.788Z","etag":null,"topics":["business","docker"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/camptocamp.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.rst","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-02-09T16:05:06.000Z","updated_at":"2025-06-13T09:35:29.000Z","dependencies_parsed_at":"2024-03-05T13:29:34.678Z","dependency_job_id":"9e9aa6ff-9093-40cc-a12a-7dd05742921b","html_url":"https://github.com/camptocamp/docker-odoo-project","commit_stats":{"total_commits":395,"total_committers":29,"mean_commits":"13.620689655172415","dds":0.5822784810126582,"last_synced_commit":"13b6aa65d63413fa29243c5007d1645cf6fa3f14"},"previous_names":[],"tags_count":71,"template":false,"template_full_name":null,"purl":"pkg:github/camptocamp/docker-odoo-project","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/camptocamp%2Fdocker-odoo-project","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/camptocamp%2Fdocker-odoo-project/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/camptocamp%2Fdocker-odoo-project/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/camptocamp%2Fdocker-odoo-project/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/camptocamp","download_url":"https://codeload.github.com/camptocamp/docker-odoo-project/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/camptocamp%2Fdocker-odoo-project/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266048493,"owners_count":23868738,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["business","docker"],"created_at":"2024-08-07T23:03:55.725Z","updated_at":"2025-07-20T00:31:09.574Z","avatar_url":"https://github.com/camptocamp.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"[![Build Status](https://app.travis-ci.com/camptocamp/docker-odoo-project.svg?branch=master)](https://app.travis-ci.com/camptocamp/docker-odoo-project)\n\n# docker-odoo-project\n\nA base image for our Odoo projects.\n\nThis image alone does nothing because it doesn't contain any Odoo's code. The\ncode should be added in a Dockerfile inheriting from this image.\n\nA project using this image has to respect a defined structure, look at the [example](example).\n\nSee also the [Changelog](HISTORY.rst).\n\n## ⚠️ Version 5.0.0 : Some Breaking changes\n  - We not longer use gosu\n  - The `odoo` user is created during the build of the image, and no longer in the entrypoint\n  - All odoo related files are moved in /odoo\n  - odoo runs with uid 999; if you need to change this, use for instance `docker-compose --build-arg UID=$(id -u)\n  - Odoo versions 7.0, 8.0, 9.0 and 10.0 are no longer supported\n\n## ⚠️ Reporting now use kwkhtmltopdf instead of wkhtmltopdf\n\nTo limit the amount of memory required on each containers to print report\n\nWe have switch to kwkhtmltopdf project : https://github.com/acsone/kwkhtmltopdf\n\nthe kwkhtmltopdf client is included in the base image, you must set the \nenv variable :\n\nKWKHTMLTOPDF_SERVER_URL=\u003curl of your KWKHTMLTOPDF server\u003e:\u003cport\u003e\n\nand you also need to specify report url to let kwkhtmltopdf server to retrive images/header etc... from odoo:\n\nODOO_REPORT_URL=\u003curl of you odoo:8069\u003e\n\n## ⚠️ Images moved to ghcr.io\n\nDue to pull limitation on docker.io the images are now pushed exclusively on ghcr.io.\n\nImages can be found under the github link \"Packages\".\nhttps://github.com/camptocamp/docker-odoo-project/pkgs/container/odoo-project\n\n## Image Flavors\n\nThere are 4 flavors of the image:\n\n- normal: `odoo-project:${odoo_version}-${tag_version}`\n\nNote: in production, we strongly recommend to never use the \"latest\" tag.\nInstead use a specific version in order to be able to rebuild identical images.\n\n\n## Build\n\nThe images should be build with `make`:\n\nNormal flavors:\n\n```\n# generate image camptocamp/odoo-project:11.0-latest and camptocamp/odoo-project:11.0-latest\n$ make VERSION=11.0\n# generate image camptocamp/odoo-project:10.0-latest and camptocamp/odoo-project:10.0-latest\n$ make VERSION=10.0\n```\n\n## Configuration\n\nThe host for the database is in `$DB_HOST` (`db` by default).\n\nA volume `/data/odoo` is declared, which is expected to contain Odoo's filestore\n(this path is set in `openerp.cfg`).\n\nPorts 8069 and 8072 are exposed by default.\n\n## Environment variables\n\n### ODOO_BASE_URL\n\nThe `ir.config_parameter` `web.base.url` will be automatically set to this\ndomain when the container starts. `web.base.url.freeze` will be set to `True`.\nDefault url is `http://localhost:8069`. If `ODOO_BASE_URL` is set to an empty\nvalue, the configuration parameters will be left unchanged.\n\n### ODOO_REPORT_URL\n\nThe `ir.config_parameter` `report.url` will be automatically set to this\ndomain when the container starts..\nDefault url is `http://localhost:8069`. As soon as we use kwkhtmltopdf\nwe must set this URL to be accessible by you kwkhtmltopdf server\n\n### KWKHTMLTOPDF_SERVER_URL\n\nIt point to the server that host the kwktmltopdf server to serve files\n\n\n### MIGRATE\n\n`MIGRATE` can be `True` or `False` and determines whether migration tool\nmarabunta will be launched. By default migration will be launched.\n\nMigration is *not* launched when using:\n\n```\n    docker-compose run --rm odoo odoo shell [...]\n    docker-compose run --rm odoo odoo [...] --help [...]\n```\n\n### MARABUNTA_MODE\n\nIn [Marabunta](https://github.com/camptocamp/marabunta) versions, you can\ndeclare additional execution modes, such as `demo` or `full` in order to choose\nwhich operations and addons are executed for a migration.\n\nA typical use case would be:\n\n* Install the set of addons in the base mode (the base mode is always executed)\n* Load an excerpt of the data in the `demo` mode, used for test instances\n* Load the complete dataset in the `full` mode, used for the integration and\n  production servers\n\nOn the test server, you would set `MARABUNTA_MODE=demo` and on the production\none `MARABUNTA_MODE=full`.\n\n### MARABUNTA_ALLOW_SERIE\n\nBy default, [Marabunta](https://github.com/camptocamp/marabunta) does not allow\nto execute more than one version upgrade at a time. This is because it is\ndangerous to execute a migration script (say 9.1.0) if the version of the code\nis not the same (say 9.2.0).\n\nFor a production server, it works, because usually you only want to upgrade to\nthe last version N from N-1.  But for development or a test server, you might\nwant to take the risk of running all the migration scripts consecutively, this\nis what `MARABUNTA_ALLOW_SERIE=True` is for.\n\n### MARABUNTA_FORCE_VERSION\n\nWhen you are developing / testing migrations with\n[Marabunta](https://github.com/camptocamp/marabunta), you can force the upgrade\nof a specific version with `MARABUNTA_FORCE_VERSION=\u003cversion\u003e`.\n\n### ODOO_DATA_PATH\n\nSpecifies path of data folder where to put base setup data for your project.\nIn `anthem` songs this allows you to pass relative paths\ninstead of recovering the full path via module resource paths.\nMore precisely, if you set this var you can skip this in your songs:\n\n```\n  from pkg_resources import Requirement, resource_stream\n\n  req = Requirement.parse('my-odoo')\n\n\n  def load_csv(ctx, path, model, delimiter=',',\n               header=None, header_exclude=None):\n      content = resource_stream(req, path)\n      load_csv(ctx, content, ...)\n```\n\nand use `anthem` loader straight::\n\n```\n  from anthem.lyrics.loaders import load_csv\n\n  load_csv('relative/path/to/file', ...)\n```\n\nNOTE: `anthem \u003e 0.11.0` is required.\n\n### LOCAL_CODE_PATH\n\nSpecifies path for local(custom) code to be used, by default is /odoo/odoo/addons\n\n### MIGRATION_CONFIG_FILE\n\nSpecifies path for migration config file, by default is /odoo/migration.yml\n\n### DEMO\n\n`DEMO` can be `True` or `False` and determines whether Odoo will load its Demo\ndata. It has effect only at the creation of the database.\n\n### User id\n\nBy default, the user ID inside of the container will be 999. There is little\nconcern with this ID until we setup a host volume: the same user ID will be\nused to write the files on the host's filesystem. 999 will probably be\ninexistent on the host system but at least it will not collide with an actual\nuser.\n\nIf you need you can make an image that inherit from this one and made\nan alter user odoo -u your udi\n\n### CREATE_DB_CACHE\n\nUsed in `bin/runtests` and `bin/runmigration`.\n\nIf set to \"true\", will create a dump in `.cachedb` of an intermediate state of the tests or migration.\nBy default not set, thus unactivated.\n\n### LOAD_DB_CACHE\n\nUsed in `bin/runtests` and `bin/runmigration`.\n\nIf set to \"false\", will skip trying to reload a cached dump from `.cachedb`.\n\n### SUBS_MD5\n\nThis value is used in `bin/runtests` to determine the name of the intermediate state to\nload or create.\n\nValue to tag a database dump of `bin/runtests`, for instance it can be based on\nsubmodules in .travis.yml of your git repositories in odoo/src and in odoo/external-src:\n\n```\nexport SUBS_MD5=$(git submodule status | md5sum | cut -d ' ' -f1)\n```\n\nYou want this value to be unique and identify your dependencies, thus if a\ndependency change you need to generate a new one.\n\n### MIG_LOAD_VERSION_CEIL\n\nUsed in `bin/runmigration` to specify from which dump we want to play the migration.\nIn case you have a dump per version, you can play the migration against the version of your choice.\nIf the version specified does not exists, it will search for a lower occurence.\n\nIt will load a dump lower than \"odoo_sample_$MIG_LOAD_VERSION_CEIL.dmp\"\nThis is useful if you bumped odoo/VERSION as it won't match existing\ndumps.\n\nFor instance you have made a dump 10.1.0, you are now on the version\n10.2.0, if you pass your current version it will search for a dump\nlower than 10.2.0 and restore the 10.1.0. Then play the remaining\nsteps on top of it.\n\n### Odoo Configuration Options\n\nThe main configuration options of Odoo can be configured through environment variables. The name of the environment variables are the same of the options but uppercased (eg. `workers` becomes `WORKERS`).\n\nLook in [11.0/templates/odoo.cfg.tmpl](11.0/templates/odoo.cfg.tmpl) to see the full list.\n\nWhile most of the variables can be set in the docker-compose file so we can have different values for different environments, the `ADDONS_PATH` **must** be set in the `Dockerfile` of your project with a line such as:\n\n```\nENV ADDONS_PATH=/odoo/local-src,/odoo/external-src/server-tools,/odoo/src/addons\n```\n\nBy setting this value in the `Dockerfile`, it will be integrated into the build and thus will be consistent across each environment.\n\nBy the way, you can add other `ENV` variables in your project's `Dockerfile` if you want to customize the default values of some variables for a project.\n\nYou can also use environment variable `ADDITIONAL_ODOO_RC` for any additional parameters that must go in the `odoo.cfg` file.\ne.g.:\n```\nADDITIONAL_ODOO_RC=\"\ncustom_param=42\nother_param='some value'\n\"\n```\n\n\n## Running tests\n\n### runtests\n\nInside the container, a script `runtests` is used for running the tests on Travis.\n\nUnless `LOAD_DB_CACHE is set to `false` it will search for a dump of dependencies and restore it.\nOtherwise, will create a new database, find the `odoo/external-src` and `odoo/src` dependencies of the local addons and\nif `CREATE_DB_CACHE` is activated creates a dump of that state.\n\nThen it will install local addons, run their tests and show the code coverage.\n\n```\ndocker-compose run --rm [-e CREATE_DB_CACHE=true] [-e LOAD_DB_CACHE=false] [-e SUBS_MD5=\u003chash\u003e] odoo runtests\n```\n\n\nThis is not the day-to-day tool for running the tests as a developer.\n\n### pytests\n\npytest is included and can be invoked when starting a container. It needs an existing database to run the tests:\n\n```\ndocker-compose run --rm -e DB_NAME=testdb odoo testdb-gen -i my_addon\ndocker-compose run --rm -e DB_NAME=testdb odoo pytest -s odoo/local-src/my_addon/tests/test_feature.py::TestFeature::test_it_passes\n```\n\nWhen you make changes in the addon, you need to update it in Odoo before running the tests again. You can use:\n\n```\ndocker-compose run --rm -e DB_NAME=testdb odoo testdb-update -u my_addon\n```\n\nWhen you are done, you can drop the database with:\n\n```\ndocker-compose run --rm odoo dropdb testdb\n```\n\n\nPytest uses a plugin (https://github.com/camptocamp/pytest-odoo) that corrects the\nOdoo namespaces (`openerp.addons`/`odoo.addons`) when running the tests.\n\n### pytest-cov\n\npytest-cov is also included and can be used to generate a coverage report. \nYou can add --cov=MODULE_PATH to your pytest to get a text version in the shell, or export it as HTML so you can browse the results.\nTo export it to HTML, add --cov-report=HTML:EXPORT_PATH\n\n### runmigration\n\nInside the container, a script `runmigration` is used to run the migration steps on Travis.\n\nThen when launched, it will search for database dump of the content of `odoo/VERSION` file.\nOr if you provided `MIG_LOAD_VERSION_CEIL` which will allow you to search for an other version.\nIf no dump is available (or `LOAD_DB_CACHE` is set to `false`), migration will start from scratch.\n\nThe migration steps are then run.\n\nIf migration succeed a dump is created if `CREATE_DB_CACHE` is set to `true`.\n\n```\ndocker-compose run --rm [-e CREATE_DB_CACHE=true] [-e LOAD_DB_CACHE=false] [-e MIG_LOAD_VERSION_CEIL=x.y.z] odoo runmigration\n```\n\nThis tools really speed up the process of testing migration steps as you can be executing only a single step instead of redoing all.\n\n### cached dumps (runtests / runmigration)\n\nTo use database dumps you will need a volume on `/.cachedb` to have persistant dumps.\n\nOn travis you will also want to activate the cache, if your volume definition is `- \"$HOME/.cachedb:/.cachedb\"`\nadd this in `.travis.yml`:\n\n```\ncache:\n  directories:\n    - $HOME/.cachedb\n```\n\n## Start entrypoint\n\nAny script in any language placed in `/start-entrypoint.d` will be\nexecuted just between the migration and the start of Odoo.\nSimilarly, scripts placed in `/before-migrate-entrypoint.d` will be\nexecuted just before the migration.\n\nThe order of execution of the files is determined by the `run-parts` 's rules.\nYou can add your own scripts in those directories. They must be named\nsomething like `010_abc` (`^[a-zA-Z0-9_-]+$`) and must have no extension (or\nit would not be picked up by `run-parts`).\n\nImportant: The database is guaranteed to exist when the scripts are run, so you\nmust take that in account when writing them. Usually you'll want to use such\ncheck:\n\n```\n  if [ \"$( psql -tAc \"SELECT 1 FROM pg_database WHERE datname='$DB_NAME'\" )\" != '1' ]\n  then\n      echo \"Database does not exist, ignoring script\"\n      exit 0\n  fi\n```\n\nThe scripts are run only if the command is `odoo`/`odoo.py`.\n\n## Legacy images\n\nLegacy images are used for projects using deprecated Odoo versions (7 \u0026 8).\nThey work the same as the newer ones, with a few differences.\n\n### Anthem\n\n`anthem` is not available in these images as the Odoo API is too old to use it.\nIf you want to script migration parts, you can write a script using `erppeek`.\n\nSidenote: You can still use SQL scripts the same as before\n\n### Demo Data\n\nIn Odoo 8, the configuration parameter `without_demo` can be sometimes buggy (Odoo will still install demo data even if it is told not to do so).\n\nTo circumvent this behavior, you can force this parameter in the command line used to start Odoo (check [migration.yml](example/odoo/migration.yml) as example).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcamptocamp%2Fdocker-odoo-project","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcamptocamp%2Fdocker-odoo-project","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcamptocamp%2Fdocker-odoo-project/lists"}