{"id":25839742,"url":"https://github.com/netresearch/docker-akeneo-app","last_synced_at":"2025-03-01T04:34:15.710Z","repository":{"id":22846414,"uuid":"97469720","full_name":"netresearch/docker-akeneo-app","owner":"netresearch","description":"Docker image with Akeneo sources ready to be ran with netresearch/akeneo-php:apache","archived":false,"fork":false,"pushed_at":"2023-10-27T07:11:25.000Z","size":49,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-11-15T04:37:12.105Z","etag":null,"topics":["akeneo","akeneo-bootstrap","composer","custom-bootstrap","docker-image","mongodb","php","pim"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/netresearch.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2017-07-17T11:40:15.000Z","updated_at":"2024-04-18T17:42:19.000Z","dependencies_parsed_at":"2024-11-15T12:16:28.643Z","dependency_job_id":null,"html_url":"https://github.com/netresearch/docker-akeneo-app","commit_stats":{"total_commits":35,"total_committers":4,"mean_commits":8.75,"dds":0.2571428571428571,"last_synced_commit":"3fc8ea75fa2ed135e84c152e45429356acdeadc1"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netresearch%2Fdocker-akeneo-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netresearch%2Fdocker-akeneo-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netresearch%2Fdocker-akeneo-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netresearch%2Fdocker-akeneo-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/netresearch","download_url":"https://codeload.github.com/netresearch/docker-akeneo-app/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241317608,"owners_count":19943199,"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":["akeneo","akeneo-bootstrap","composer","custom-bootstrap","docker-image","mongodb","php","pim"],"created_at":"2025-03-01T04:34:15.119Z","updated_at":"2025-03-01T04:34:15.700Z","avatar_url":"https://github.com/netresearch.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![packagist](https://img.shields.io/packagist/v/netresearch/akeneo-bootstrap.svg?style=flat)](https://packagist.org/packages/netresearch/akeneo-bootstrap)\n[![docker pulls](https://img.shields.io/docker/pulls/netresearch/akeneo-app.svg?style=flat)](https://hub.docker.com/r/netresearch/akeneo-app/tags/)\n[![travis](http://img.shields.io/travis/netresearch/docker-akeneo-app.svg?style=flat-square)](https://travis-ci.org/netresearch/docker-akeneo-app)\n\n---\n\nThis is\n\n1. The composer package [netresearch/akeneo-bootstrap](https://packagist.org/packages/netresearch/akeneo-bootstrap) to bootstrap Akeneo projects and configure them from other packages rather than via their own config files (better updatability).\n2. The Docker image [netresearch/akeneo-app](https://hub.docker.com/r/netresearch/akeneo-app/) providing a ready built [Akeneo PIM](https://www.akeneo.com/) project, ready to run with MongoDB and optimized for best possible updatability utilizing [akeneo-bootstrap](#composer-package-akeneo-bootstrap).\n\n# Contents\n\n- [Composer package](#composer-package)\n  - [`akeneo-project`](#akeneo-project)\n    - [Installation](#installation)\n    - [Creating a project](#creating-a-project)\n    - [Up/downgrading a project](#updowngrading-a-project)\n  - [`akeneo-bootstrap`](#akeneo-bootstrap)\n    - [Environment variables](#environment-variables)\n    - [Customizing Akeneo from other packages](#customizing-akeneo-from-other-packages)\n      - [Adding bundles](#adding-bundles)\n      - [Adding configs](#adding-configs)\n      - [Adding routings](#adding-routings)\n      - [Adding custom bootstraps](#adding-custom-bootstraps)\n- [Docker image](#docker-image)\n  - [Run](#run)\n  - [Environment variables](#environment-variables)\n  - [Customize Akeneo](#customize-akeneo)\n\n# Composer package\n\nThe common way to install Akeneo is to create a composer project from [akeneo/pim-community-standard](https://packagist.org/packages/akeneo/pim-community-standard) which has major drawbacks:\n\n1. Akeneo [still](https://www.akeneo.com/forums/topic/please-add-akeneopim-community-dev-at-packagist/) didn't publish its core package to packagist which thus needs to be provided as composer repository. As the corresponding github repository has tons of branches and tags using it for composer is firstly damn slow and secondly makes composer reach the github API limits which can hardly be handled in any environment where you don't want to expose your github API key. Also there is no way for other packages to require *akeneo/pim-community-dev* as long as the github repository is not added in the root composer.json. \n2. `composer create-project` naturally creates the project once - if you want to update to a newer version of the original project there is no easy way to this with composer. Rather you'll be forced to update the copied sources following the upgrade instructions which is - at least for us - not what we would \n3. If you need to change Akeneo configs, routings or add Bundles you have to touch the code generated by `composer create-project` which makes updating even harder.\n\nYou could also download a ready built Akeneo project - the updating issues however remain.\n\nThis package provides a mechanism to work around the problems above:\n\n1. It provides the plain shell script [akeneo-project](#akeneo-project) to create or upgrade an Akeneo project.\n2. It provides the command line application [akeneo-bootstrap](#akeneo-bootstrap) which generates configuration in the project from according instructions in installed packages and sets Akeneo up for running.\n\nIt replaces [incenteev/parameter-handler](https://github.com/Incenteev/ParameterHandler) which is registered for composers post-install-cmd and post-update-cmd and thus is invoked automatically to generate the AppKernel, configs and routings when packages are installed (steps 1 - 4 of [akeneo-bootstrap](#akeneo-bootstrap) command).\n\n## `akeneo-project`\n\nUse the `akeneo-project` script to create or upgrade an Akeneo project. It also installs netresearch/akeneo-bootstrap into the project (which automatically invokes 1 - 4 of the [akeneo-bootstrap](#akeneo-bootstrap) command).\n\n### Installation\n\nThe script is standalone but as it requires PHP and composer anyway you better install it with composer:\n\n```bash\ncomposer global require netresearch/akeneo-bootstrap\nakeneo-project -h\n```\n\n### Creating a project\n\n```bash\nakeneo-project create -v 1.7.6\n```\n\n### Up/downgrading a project\n\n```bash\nakeneo-project upgrade -v 1.7.6\n```\n\n## `akeneo-bootstrap`\n\nThe `akeneo-bootstrap` command is shipped with the composer package `netresearch/akeneo-bootstrap` which is also installed by [akeneo-project](#akeneo-project). It executes the following steps:\n\n1. Generate the AppKernel (overriding, not replacing the original Akeneo AppKernel) with bundles required by any installed packages\n2. Generate (local) config and routing files invoking resources required by any installed packages\n3. Generate the parameters.yml from environment variables\n4. Fix PIM, ORO and Symfony requirements (adjust paths)\n5. Clear cache if required by any of the previous steps\n6. Boot the kernel\n7. Wait for the database to be up\n8. Ensure the Akeneo installation (check requirements, install / upgrade DB, dump assets)\n9. Set export/import paths\n10. Link static directories if required (Akeneo sometimes doesn't use the configured directories but fixed paths like `app/logs` - this step symlinks those directories to the configured ones like [LOG_DIR](#environment-variables))\n11. chown the directories required to be writable from web (see [WEB_USER](#environment-variables))\n\n### Environment variables\n\n[akeneo-bootstrap](#akeneo-bootstrap) uses the following environment variables to configure Akeneo:\n\n| Variable | Description | Default |\n| --- | --- | --- |\n| DATABASE_DRIVER | The database driver | pdo_mysql |\n| DATABASE_HOST | The database host name | localhost |\n| DATABASE_PORT | The database port | 3306 |\n| DATABASE_NAME | Name of the database | akeneo_pim |\n| DATABASE_USER | Database user name | akeneo_pim |\n| DATABASE_PASSWORD | Database users password | akeneo_pim |\n| LOCALE | The locale for Akeneo | en |\n| SECRET | Entropy string for security related operations | `hash('sha256', uniquid())` |\n| PIM_CATALOG_PRODUCT_STORAGE_DRIVER | Set this to `doctrine/mongodb-odm` when you want to use MongoDB | - |\n| MONGODB_SERVER | If set (e.g. to `mongodb://mongodb:27017`), the DoctrineMongoDBBundle will automatically activated. | - |\n| MONGODB_DATABASE | If you use MongoDb you must provide a database name, which will be used for the product collections | - |\n| CACHE_DIR | Path for symfony caches | /var/cache/akeneo |\n| LOG_DIR | Path for the Akeneo logs | /var/log/akeneo | \n| UPLOAD_DIR | Path where uploads should be stored | /var/opt/akeneo/uploads/product |\n| CATALOG_STORAGE_DIR | catalog_storage_dir | /var/opt/akeneo/file_storage/catalog |\n| ARCHIVE_DIR | archive_dir | /var/opt/akeneo/archive |\n| EXPORT_PATH | Set this to change the directory to where exports should go. | /var/opt/akeneo/exports |\n| IMPORT_PATH | Set this to change the directory from where imports should be read. | /var/opt/akeneo/imports |\n| *_PATH | Set this with the asterisk replaced by the job name in upper case (e.g. CATEGORY_IMPORT_PATH) to change the file path for a particular job (overrides EXPORT_PATH or IMPORT_PATH for this job) | - |\n| WEB_USER | User name to be set as owner for directories that need to be writable by Akeneo from Web | www-data.www-data |\n| PARAMETER_* | Any parameter (e.g. from pim_parameters.yml) which is NOT one of the above (f.e. `PARAMETER_INSTALLER_DATA=\"/opt/acme/fixtures\"` to [use another dataset](https://docs.akeneo.com/1.7/cookbook/setup_data/customize_dataset.html) | - |\n| USE_FIXTURE_PATHS |  Set this to use configured import and export paths from fixture files. All other configured ..._PATH will ignored. | - |\n\nThe configuration via environment variables was chosen because the package is primarily targeted at installations in Docker containers. If you don't use such and don't want to clutter your environment variables with the above, you could put them into an [.env file](https://docs.docker.com/compose/env-file/) and run [akeneo-bootstrap](#akeneo-bootstrap) and composer commands like this:\n\n```bash\neval $(cat .env) composer update\n```\n\n## Customizing Akeneo from other packages\n\n[akeneo-bootstrap](#akeneo-bootstrap) will scan all installed packages for settings in their composer.json allowing you to register Bundles, configs, routings and custom bootstrap steps to customize Akeneo like so:\n\n```json\n{\n   \"name\": \"acme/akeneo-config\",\n   \"version\": \"1.0.0\",\n   \"require\": {\n       \"akeneo-labs/custom-entity-bundle\": \"1.10.*\"\n   },\n   \"extra\": {\n       \"netresearch/akeneo-bootstrap\": {\n            \"generate\": [\n                \"Acme\\\\AkeneoConfig\\\\Bootstrap\\\\Generate\"\n            ],\n            \"boot\": [\n                \"Acme\\\\AkeneoConfig\\\\Bootstrap\\\\Boot\"\n            ],\n            \"bundles\": [\n                { \"class\": \"Pim\\\\Bundle\\\\CustomEntityBundle\\\\PimCustomEntityBundle\" }\n            ],\n            \"routing\": {\n                \"pim_customentity\": {\n                    \"resource\": \"@PimCustomEntityBundle/Resources/config/routing.yml\",\n                    \"prefix\": \"/reference-data\"\n                }\n            }\n        }\n    }\n}\n```\n\nAfter installing or updating this package *akeneo-bootstrap* will automatically update the Kernel and local configuration and routing files to add the configured resources.\n\n*Please note* that changes to this composer.json files only take effect when the package is actually updated or installed - if you only change it in the vendor package nothing will happen.\n\n### Adding bundles\n\nBundles are to be registered as objects in an array in `extra.netresearch/akeneo-bootstrap.bundles` in your composer.json. Each of them must have a `class` property containing the bundle class and can have a `env` property containing an array of or an comma separated string with environment names:\n\n```json\n{\n   \"name\": \"acme/akeneo-config\",\n   \"version\": \"1.0.0\",\n   \"extra\": {\n       \"netresearch/akeneo-bootstrap\": {\n            \"bundles\": [\n                {\n                    \"class\": \"Acme\\\\Bundle\\\\AllEnvsBundle\"\n                },\n                {\n                    \"class\": \"Acme\\\\Bundle\\\\ProdOnlyBundle\",\n                    \"env\": \"prod\"\n                },\n                {\n                    \"class\": \"Acme\\\\Bundle\\\\DevAndTestOnlyBundle\",\n                    \"env\": [\"dev\", \"test\"]\n                }\n            ]\n        }\n    }\n}\n```\n\n**Note** that *all* packages are scanned for this. This allows you to require a single package in the project which requires other packages that contain such configuration as well.\n\n### Adding configs\n\nConfig files are to be registered as objects in an array in `extra.netresearch/akeneo-bootstrap.config` in your composer.json. Each of them must have a `resource` property containing the file path and can have a `env` property containing an array of or an comma separated string with environment names:\n\n```json\n{\n   \"name\": \"acme/akeneo-config\",\n   \"version\": \"1.0.0\",\n   \"extra\": {\n       \"netresearch/akeneo-bootstrap\": {\n            \"config\": [\n                {\n                    \"resource\": \"../../vendor/acme/akeneo-config/Resources/config/general.yml\"\n                },\n                {\n                    \"resource\": \"../../vendor/acme/akeneo-config/Resources/config/prod.yml\",\n                    \"env\": \"prod\"\n                },\n                {\n                    \"resource\": \"../../vendor/acme/akeneo-config/Resources/config/dev.yml\",\n                    \"env\": [\"dev\", \"test\"]\n                }\n            ]\n        }\n    }\n}\n```\n\n### Adding routings\n\nRouting files are to be registered as objects in an object in `extra.netresearch/akeneo-bootstrap.routing` in your composer.json. Each of them must have a `resource` property containing the file path and can have a `env` property containing an array of or an comma separated string with environment names. The keys are the keys under which they are registered in the routing_local.yml's:\n\n```json\n{\n   \"name\": \"acme/akeneo-config\",\n   \"version\": \"1.0.0\",\n   \"extra\": {\n       \"netresearch/akeneo-bootstrap\": {\n            \"routing\": {\n                \"all_envs\": {\n                    \"resource\": \"@AllEnvsBundle/Resources/config/routing.yml\"\n                },\n                \"prod\": {\n                    \"resource\": \"../../vendor/acme/akeneo-config/Resources/config/routing_prod.yml\",\n                    \"env\": \"prod\"\n                },\n                \"test\": {\n                    \"resource\": \"../../vendor/acme/akeneo-config/Resources/config/routing_dev.yml\",\n                    \"env\": [\"dev\", \"test\"]\n                }\n            }\n        }\n    }\n}\n```\n\n### Adding custom bootstraps\n\nThere are two scopes of bootstraps: **generate** (Akeneo/DB not necessarily initialized; invoked after `composer update/install` and from `./bin/akeneo-bootstrap`) and **boot** (Akeneo/DB ready to run, invoked only from `./bin/akeneo-bootstrap` right after `generate`). Custom bootstrap classes can be registered for each of those scopes as array of class names in `extra.netresearch/akeneo-bootstrap.{SCOPE}` in your composer.json. Each of those classes have to implement `\\Netresearch\\AkeneoBootstrap\\Bootstrap\\BootstrapInterface`.\n\n```json\n{\n   \"name\": \"acme/akeneo-config\",\n   \"version\": \"1.0.0\",\n   \"extra\": {\n       \"netresearch/akeneo-bootstrap\": {\n            \"generate\": [\n                \"Acme\\\\AkeneoConfig\\\\Bootstrap\\\\Generate\"\n            ],\n            \"boot\": [\n                \"Acme\\\\AkeneoConfig\\\\Bootstrap\\\\Boot\"\n            ]\n        }\n    }\n}\n```\n\nA bootstrap could for instance look like this:\n\n```php\n\u003c?php\nnamespace Acme\\AkeneoConfig\\Bootstrap;\n\nuse \\Netresearch\\AkeneoBootstrap\\Bootstrap\\BootstrapAbstract;\n\nclass Generate extends BootstrapAbstract {\n    public function getMessage() {\n        return 'Forcing cache to be cleared'\n            . ' (cache dir: ' . $this-\u003egetKernel()-\u003egetCacheDir() . ')';\n    }\n\n    public function run()\n    {\n        $this-\u003eisCacheClearRequired(true);\n    }\n}\n```\n\nHave a look at the [present bootstraps](https://github.com/netresearch/docker-akeneo-app/tree/master/src/Bootstrap) for further examples.\n\n# Docker image\n\nThe Docker image [netresearch/akeneo-app](https://hub.docker.com/r/netresearch/akeneo-app) is an alpine image containing an Akeneo project setup with [akeneo-project](#akeneo-project) in `/var/www/html` and the `akeneo-project` script itself in `/opt/akeneo-bootstrap/bin/akeneo-project`.\n\nWhen this image is used with [netresearch/akeneo-php:apache](https://hub.docker.com/r/netresearch/akeneo-php) or [netresearch/akeneo-php](https://hub.docker.com/r/netresearch/akeneo-php) with `akeneo-php-entrypoint` set as entrypoint [akeneo-bootstrap](#akeneo-bootstrap) will automatically be invoked on container start.\n\n## Run\n\nThis image only contains source files. To run Akeneo with it, PHP, a MySQL/MariaDB database and - both optionally an Apache and a MongoDB - are required.\n\nAkeneo has several PHP platform dependencies which is why we recommend using our Akeneo specialized [PHP Docker images](https://hub.docker.com/r/netresearch/akeneo-php/) for that (available as PHP only and PHP+Apache).\n\nIt's best to run it using docker-compose. See [here](https://github.com/netresearch/docker-akeneo-app/blob/master/docker-compose.yml) for an example.\n\nIn order to **develop with Akeneo**, you can additionally use this [docker-compose.override.yml](https://github.com/netresearch/docker-akeneo-app/blob/master/docker-compose.override.yml) along with a Dockerfile like the one below.\n\n## Environment variables\n\nAs those for [akeneo-bootstrap](#environment-variables).\n\n## Customize Akeneo\n\nThis image provides a ready built Akeneo project (`composer install` already done) which is not meant to be customized by hacking around in its configuration and kernel - it rather uses [netresearch/akeneo-bootstrap](#composer-package) to be [customizable by other packages](#customizing-akeneo-from-other-packages).\n\nTo install your own packages you should extend this image with a custom docker file - we suggest following [multistage build file](https://docs.docker.com/engine/userguide/eng-image/multistage-build/#use-multi-stage-builds) to keep the resulting image small:\n\n```Dockerfile\nFROM netresearch:akeneo-app as sources\n\nFROM netresearch:akeneo-php as builder\nCOPY --from=sources /var/www/html /var/www/html\nWORKDIR /var/www/html\n\n# You can use private packages by adding them into \n# /src/packages/{vendor}/{packagename}\n# THOSE PACKAGES NEED TO HAVE A version TO BE SET IN THEIR composer.json\n# see above for further information\nCOPY ./packages/acme/akeneo-config /src/packages/acme/akeneo-config\n\nRUN composer require acme/akeneo-config\n\nFROM alpine\nCOPY --from=builder /src/packages /src/packages\nCOPY --from=builder /var/www/html /var/www/html\n\n# If you will mount a local directory to /var/www/html\n# which is what you'll likely do during development\n# it is a good idea to also copy akeneo-project\n# (see docker-compose.override.yml for how to invoke)\nCOPY --from=sources /usr/local/bin/akeneo-project /opt/akeneo-bootstrap/bin/akeneo-project\n```\n\n# GitHub\n\nIf you have any problems, questions, feature requests or simply stars to give please visit the [GitHub repository](https://github.com/netresearch/docker-akeneo-app).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetresearch%2Fdocker-akeneo-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnetresearch%2Fdocker-akeneo-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetresearch%2Fdocker-akeneo-app/lists"}