# Pimcore + Docker

**URL:** https://forum.ficusonline.com/t/topic/378
**Category:** WEB Design
**Created:** [2020 年 7 月 7 日午後 1:54 UTC](https://forum.ficusonline.com/t/topic/378 "2020-07-07T13:54:18Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![tk-fuse](https://forum.ficusonline.com/user_avatar/forum.ficusonline.com/tk-fuse/32/255_2.png) [@tk-fuse](https://forum.ficusonline.com/u/tk-fuse)
#### Post date: [2020 年 7 月 7 日午後 1:54 UTC](https://forum.ficusonline.com/t/topic/378/1 "2020-07-07T13:54:19Z")

</div>

PimcoreのDockerコンテナを作成

### Pimcore PHP-FPM Image

> **[pimcore/pimcore - Docker Image](https://hub.docker.com/r/pimcore/pimcore)**

### Pimcore Installation

[https://pimcore.com/docs/6.x/Development\_Documentation/Getting\_Started/Installation.html](https://pimcore.com/docs/6.x/Development_Documentation/Getting_Started/Installation.html)

> **[GitHub - StefanieD/pimcore-docker-setup: Simple Docker setup for pimcore](https://github.com/StefanieD/pimcore-docker-setup)**
>
> Simple Docker setup for pimcore

Nginxで運用するため、以下のfpmバージョンのイメージを採用。

**pimcore/pimcore:PHP7.2-fpm or pimcore/pimcore:PHP7.2-fpm-stretch**

上記イメージファイルによりPimcoreコンテナ作成後、コンテナ内でcomposerコマンドを実行

```auto
COMPOSER_MEMORY_LIMIT=-1 composer create-project pimcore/demo pimcore

```

ユーザ名、パスワード、mysqlホスト、データベース名などを指定してインストールスクリプトを実行。  
（–mysql-host-socketだけを指定して実行）

```auto
cd pimcore && COMPOSER_MEMORY_LIMIT=-1 ./vendor/bin/pimcore-install --mysql-host-socket=localhost

```

デイレクトリの所有者とアクセス権を修正します。

```auto
chown -R www-data:www-data pimcore
chmod -R 755 pimcore

```

注）  
データベースセットアップには時間を要します。  
**php.ini** 設定ファイル内で **memory\_limit 512M** に設定しているかどうか要確認

```auto
Running database setup...

  6/11 [===============>------------] 54%

```

Pimcoreの **Nginxの設定** を追加後、動作を確認して下さい。  
[https://pimcore.com/docs/pimcore/current/Development\_Documentation/Installation\_and\_Upgrade/System\_Setup\_and\_Hosting/Nginx\_Configuration.html](https://pimcore.com/docs/pimcore/current/Development_Documentation/Installation_and_Upgrade/System_Setup_and_Hosting/Nginx_Configuration.html)

---

<div class="post-metadata">

### Author: ![tk-fuse](https://forum.ficusonline.com/user_avatar/forum.ficusonline.com/tk-fuse/32/255_2.png) [@tk-fuse](https://forum.ficusonline.com/u/tk-fuse)
#### Post date: [2021 年 9 月 9 日午後 3:59 UTC](https://forum.ficusonline.com/t/topic/378/2 "2021-09-09T15:59:29Z")

</div>

## Pimcore10 Docker Image

### Pimcore10イメージ

PHP8.0が必須のため以下のイメージを使用（ **Ubuntu** ベース）。

**`pimcore/pimcore:PHP8.0-fpm`**

> **[Image Layer Details - pimcore/pimcore:PHP8.0-fpm](https://hub.docker.com/layers/pimcore/pimcore/PHP8.0-fpm/images/sha256-f1535d145bfee403770d0d0faa4789d3d02b418cd6edc0bee4a5cd588a8c02c5?context=explore)**

### Nginxイメージ

**Alpine** ベースのイメージを使用。

> **[Image Layer Details - nginx:1.20.1-alpine](https://hub.docker.com/layers/library/nginx/1.20.1-alpine/images/sha256-8aa43d4fc22f10ce729752af0a895f015360d46429902f075fe87c5d882d8d7d)**

* * *

## ファイルパーミッション

### www-dataのID番号の相違

**Ubuntu** と **Alpine** とではwww-dataのIDが異なることに注意。

> <https://gist.github.com/zdenekdrahos/53f16cfe902ff5f820a01b79e8c76a01>

| UID/GID | Ubuntu | Alpine |
| --- | --- | --- |
| 33 | www-data | xfs |
| 82 | - | www-data |

**Nginx** と **PHP8.0-fpm** 双方のコンテナに共有のフォルダ **`www/html/pimcore`** に **Nginx** による管理者権限を与えるため、 **Nginx** のコンテナ内で以下パーミッションを設定。

```auto
$ docker exec -ti nginx bash 
# chown -R nginx:nginx pimcore
# find pimcore -type d -exec chmod 755 {} \;
# find pimcore -type f -exec chmod 644 {} \;

```

**pimcore** フォルダ内の **`var public/var`** フォルダについては **PHP8.0-fpm** ユーザに管理者権限を付与する必要があるため以下追加。  
（ユーザは、Nginxコンテナ内では **xfs** ,PHP8.0-fpmコンテナ内では **www-data** とすること。）

**上記コンソール画面の続き**

```auto
# cd pimcore
# chown -R xfs:xfs var public/var bin/*
# chmod ug+x bin/*
# chmod -R 440 config

```

**Pimcore File Permission**  
[https://pimcore.com/docs/pimcore/current/Development\_Documentation/Installation\_and\_Upgrade/System\_Setup\_and\_Hosting/File\_Permissions.html](https://pimcore.com/docs/pimcore/current/Development_Documentation/Installation_and_Upgrade/System_Setup_and_Hosting/File_Permissions.html)

* * *

参考

> <https://askubuntu.com/questions/339015/what-does-mean-in-the-find-command>

[explainshell.com - find . -name \* -exec ls -a {} \;](https://explainshell.com/explain?cmd=find+.+-name++%2A+-exec+ls+-a+%7B%7D+%5C%3B#)

---

<div class="post-metadata">

### Author: ![tk-fuse](https://forum.ficusonline.com/user_avatar/forum.ficusonline.com/tk-fuse/32/255_2.png) [@tk-fuse](https://forum.ficusonline.com/u/tk-fuse)
#### Post date: [2021 年 9 月 27 日午前 8:10 UTC](https://forum.ficusonline.com/t/topic/378/3 "2021-09-27T08:10:12Z")

</div>

## クローンジョブ

ホストマシンでコンテナのクローンジョブを実行。 **php-fpmのユーザ（www-data等）** を指定すること。

```auto
$ sudo crontab -e
*/10 * * * * docker exec -u www-data pimcore-fpm /var/www/html/pimcore10/bin/console pimcore:maintenance --async

```

下記下段のジョブは任意。最新のエラーログを表示・確認する際に便利。

[https://pimcore.com/docs/pimcore/current/Development\_Documentation/Getting\_Started/Installation.html#page\_5-Maintenance-Cron-Job](https://pimcore.com/docs/pimcore/current/Development_Documentation/Getting_Started/Installation.html#page_5-Maintenance-Cron-Job)

```auto
# this command needs anyway executed via cron or similar task scheduler
# it fills the message queue with the necessary tasks, which are then processed by messenger:consume
*/5 * * * * /your/project/bin/console pimcore:maintenance --async

# it's recommended to run the following command using a process control system like Supervisor
# please follow the Symfony Messenger guide for a best practice production setup: 
# https://symfony.com/doc/current/messenger.html#deploying-to-production
*/5 * * * * /your/project/bin/console messenger:consume pimcore_core pimcore_maintenance --time-limit=300

```

**docker execコマンド**

> **[docker container exec](https://docs.docker.com/reference/cli/docker/container/exec/)**

---

<div class="post-metadata">

### Author: ![tk-fuse](https://forum.ficusonline.com/user_avatar/forum.ficusonline.com/tk-fuse/32/255_2.png) [@tk-fuse](https://forum.ficusonline.com/u/tk-fuse)
#### Post date: [2022 年 3 月 16 日午前 12:37 UTC](https://forum.ficusonline.com/t/topic/378/4 "2022-03-16T00:37:18Z")

</div>

### 使用しないバンドルの無効化

下記コマンド（コンテナ内）でバンドルリストを確認後、無効化。

```auto
# bin/console pimcore:bundle:list
+------------------------------------------+---------+-----------+-------------+---------------+----------+
| Bundle | Enabled | Installed | Installable | Uninstallable | Priority |
+------------------------------------------+---------+-----------+-------------+---------------+----------+
| PimcoreCustomerManagementFrameworkBundle | ❌ | ❌ | ❌ | ❌ | ❌ |
| OutputDataConfigToolkitBundle | ❌ | ❌ | ❌ | ❌ | ❌ |
| PimcoreDataHubBundle | ❌ | ❌ | ❌ | ❌ | ❌ |
| PimcoreEcommerceFrameworkBundle | ❌ | ❌ | ❌ | ❌ | ❌ |
| PimcorePaymentProviderUnzerBundle | ❌ | ❌ | ❌ | ❌ | ❌ |
| NumberSequenceGeneratorBundle | ❌ | ❌ | ❌ | ❌ | ❌ |
| ObjectMergerBundle | ✔ | ✔ | ❌ | ❌ | ✔ |
| Web2PrintToolsBundle | ❌ | ❌ | ❌ | ❌ | ❌ |
+------------------------------------------+---------+-----------+-------------+---------------+----------+

```

例）イーコマースバンドルは使用していないので、

```auto
# bin/console pimcore:bundle:disable PimcoreEcommerceFrameworkBundle

```

設定ファイルからイーコマース関連の設定ファイルも無効化。

**`config/config.yaml`**

```auto
imports:
    - { resource: services.yaml }
    - { resource: 'local/' }
# - { resource: ecommerce/base-ecommerce.yaml }
# - { resource: cmf.yaml }
    - { resource: workflows.yaml }

```

**`config/services.yaml`** からも不必要なイーコマースに関係する箇所を削除またはコメントアウトすること（一部抜粋）。下記 **`secret: xxxxxxxxxx.....`** は必要。

```auto
parameters:
    secret: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    #google_client_id: <google_client_id>
    #google_client_secret: <google_client_secret>
    #twitter_client_id: <twitter_client_id>
    #twitter_client_secret: <twitter_client_secret>
......
......
......

```

### Symfony Framework Configuration Reference (FrameworkBundle)

> **[secret - Framework Configuration Reference (FrameworkBundle) (Symfony Docs)](https://symfony.com/doc/current/reference/configuration/framework.html#secret)**
>
> The FrameworkBundle defines the main framework configuration, from sessions and translations to forms, validation, routing and more. All these options are configured under the framework key in your application configuration. | The FrameworkBundle...

### Workflow Management

[https://pimcore.com/docs/pimcore/current/Development\_Documentation/Workflow\_Management/index.html#page\_Workflow-Management](https://pimcore.com/docs/pimcore/current/Development_Documentation/Workflow_Management/index.html#page_Workflow-Management)

> **[Workflow (Symfony Docs)](https://symfony.com/doc/current/workflow.html)**
>
> Using the Workflow component inside a Symfony application requires first knowing some basic theory and concepts about workflows and state machines. Read this article for a quick overview. Installatio…

---

<div class="post-metadata">

### Author: ![tk-fuse](https://forum.ficusonline.com/user_avatar/forum.ficusonline.com/tk-fuse/32/255_2.png) [@tk-fuse](https://forum.ficusonline.com/u/tk-fuse)
#### Post date: [2022 年 3 月 19 日午前 5:12 UTC](https://forum.ficusonline.com/t/topic/378/6 "2022-03-19T05:12:26Z")

</div>

### イーコマースとカスタマーユーザで使用している **HWIOAuthBundle** を無効化

以下のファイルから **HWIOAuthBundle** の箇所をコメントアウト。

**`src/Kernal.php`**

```auto
namespace App;

/*use HWI\Bundle\OAuthBundle\HWIOAuthBundle;*/
use Pimcore\HttpKernel\BundleCollection\BundleCollection;
use Pimcore\Kernel as PimcoreKernel;

class Kernel extends PimcoreKernel
{
    /**
     * Adds bundles to register to the bundle collection. The collection is able
     * to handle priorities and environment specific bundles.
     *
     * @param BundleCollection $collection
     */
    public function registerBundlesToCollection(BundleCollection $collection)
    {

        // activate bundle for SSO oauth login/register functionality
        if (class_exists('\Http\HttplugBundle\HttplugBundle')) {
            $collection->addBundle( new \Http\HttplugBundle\HttplugBundle());
        }
        /*$collection->addBundle(HWIOAuthBundle::class);*/

    }
}

```

### Pimcore Single Sign On

[https://pimcore.com/docs/customer-management-framework/current/Single\_Sign\_On.html#page\_Single-Sign-On-SSO](https://pimcore.com/docs/customer-management-framework/current/Single_Sign_On.html#page_Single-Sign-On-SSO)

### Symfony Authenticating Users

> **[Authenticating Users - Security (Symfony Docs)](https://symfony.com/doc/current/security.html#authenticating-users)**
>
> Symfony provides many tools to secure your application. Some HTTP-related security tools, like secure session cookies and CSRF protection are provided by default. The SecurityBundle, which you will learn about in this guide, provides all...

### Github HWIOAuthBundle

> <https://github.com/hwi/HWIOAuthBundle/blob/master/docs/1-setting_up_the_bundle.md>

* * *

イーコマース、カスタマーマネージメントフレームワークの設定ファイルの読込みをコメントアウトして無効化。

**`config/config.yaml`**

```auto
imports:
    - { resource: services.yaml }
    - { resource: 'local/' }
# - { resource: ecommerce/base-ecommerce.yaml } 
# - { resource: cmf.yaml }
    - { resource: workflows.yaml }

```

HWIOAuthの箇所をコメントアウトまたは削除

**`config/routes.yaml`**

```auto
#hwi_oauth_redirect:
# resource: "@HWIOAuthBundle/Resources/config/routing/redirect.xml"
# prefix: /connect

#hwi_oauth_connect:
# resource: "@HWIOAuthBundle/Resources/config/routing/connect.xml"
# prefix: /connect

#hwi_oauth_login:
# resource: "@HWIOAuthBundle/Resources/config/routing/login.xml"
# prefix: /auth/oauth

#app_auth_oauth_check_google:
# path: /auth/oauth/check/google

#app_auth_oauth_check_twitter:
# path: /auth/oauth/check/twitter

```

不必要な箇所をコメントアウトまたは削除。

**`config/services.yaml`**

```auto
parameters:
    secret: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# google_client_id: <google_client_id>
# google_client_secret: <google_client_secret>
# twitter_client_id: <twitter_client_id>
# twitter_client_secret: <twitter_client_secret>
    
    # use echo \Defuse\Crypto\Key::createNewRandomKey()->saveToAsciiSafeString(); to generate secret for data encryption
    app_encryption_secret: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

services:
    # default configuration for services in *this* file
    _defaults:
        # automatically injects dependencies in your services
        autowire: true
        # automatically registers your services as commands, event subscribers, etc.
        autoconfigure: true
        # this means you cannot fetch services directly from the container via $container->get()
        # if you need to do this, you can override this setting on individual services
        public: false

    # ---------------------------------------------------------
    # Register all controllers of App as services
    # ---------------------------------------------------------
    App\Controller\:
        resource: '../src/Controller'
        public: true
        tags: ['controller.service_arguments']

    # ---------------------------------------------------------
    # Register all commands of App as commands
    # ---------------------------------------------------------
    App\Command\:
        resource: '../src/Command'
        tags: ['console.command']

    # ---------------------------------------------------------
    # Forms
    # ---------------------------------------------------------
# App\Form\DeliveryAddressFormType: ~
# App\Form\LoginFormType: ~
# App\Form\RegistrationFormType: ~
# App\Form\RegistrationFormHandler: ~
# App\Form\CarSubmitFormType: ~

    # ---------------------------------------------------------
    # Misc Services
    # ---------------------------------------------------------
    App\Services\PasswordRecoveryService: ~
    App\Services\NewsletterDoubleOptInService: ~
    App\Services\SegmentTrackingHelperService: ~
    App\Services\Workflow\CustomHtmlService: ~
    App\Website\Navigation\BreadcrumbHelperService: ~

# App\Model\Product\CalculatedValue\QualityCalculator:
# public: true

# App\Model\Product\CalculatedValue\AccessoryPartName:
# public: true

    # ---------------------------------------------------------
    # Twig Extensions
    # ---------------------------------------------------------
# App\Twig\Extension\CategoryFilterExtension:
# tags: ['twig.extension']

# App\Twig\Extension\Country:
# tags: ['twig.extension']

# App\Twig\Extension\Currency:
# tags: ['twig.extension']

    App\Twig\Extension\GeneralFilterExtension:
        tags: ['twig.extension']

    App\Twig\Extension\NavigationExtension:
        tags: ['twig.extension']

    App\Twig\Extension\UniqidExtension:
        tags: ['twig.extension']

    App\Twig\Extension\LanguageSwitcherExtension:
        tags: ['twig.extension']

# App\Twig\Extension\ProductPageExtension:
# tags: ['twig.extension']

    App\Twig\Extension\BlogExtension:
        tags: ['twig.extension']

    App\Twig\Extension\NewsExtension:
        tags: ['twig.extension']

# App\Twig\Extension\PrintCatalogExtension:
# tags: ['twig.extension']

    # ---------------------------------------------------------
    # Link Generators for DataObjects
    # ---------------------------------------------------------
# App\Website\LinkGenerator\CategoryLinkGenerator:
# public: true

# App\Website\LinkGenerator\ProductLinkGenerator:
# public: true

    App\Website\LinkGenerator\BlogLinkGenerator:
        public: true

    App\Website\LinkGenerator\NewsLinkGenerator:
        public: true

    # ---------------------------------------------------------
    # Overwrite Pimcore Default Services
    # ---------------------------------------------------------

    # overwrite PimcoreUrl helper to add existing parameters to generated urls
    Pimcore\Twig\Extension\Templating\PimcoreUrl:
        class: App\Website\Tool\PimcoreUrl
        arguments:
            $generator: '@router'

    # ---------------------------------------------------------
    # Event Listeners
    # ---------------------------------------------------------

    # auto sets name based on key for bodystyle, manufacturer, category
# App\EventListener\NameSettingListener:
# tags:
# - { name: kernel.event_listener, event: pimcore.dataobject.preAdd, method: onPreAdd }

    # adds additional static files to admin backend
    App\EventListener\PimcoreAdminListener:
        tags:
            - { name: kernel.event_listener, event: pimcore.bundle_manager.paths.css, method: addCSSFiles }
            - { name: kernel.event_listener, event: pimcore.bundle_manager.paths.js, method: addJSFiles }
            - { name: kernel.event_listener, event: pimcore.admin.resolve.elementAdminStyle, method: onResolveElementAdminStyle }

    # checkout listeners for ecommerce application
# App\EventListener\CheckoutEventListener:
# tags:
# - { name: kernel.event_listener, event: pimcore.ecommerce.ordermanager.postUpdateOrder, method: onUpdateOrder }
# - { name: kernel.event_listener, event: pimcore.ecommerce.commitorderprocessor.sendConfirmationMails, method: sendConfirmationMail }
# - { name: kernel.event_listener, event: pimcore.ecommerce.commitorderprocessor.postCommitOrder, method: postCommitOrder }

    # authentication login listener for updating e-commerce framework environment after login
# App\EventListener\AuthenticationLoginListener:
# arguments:
# $httpUtils: '@security.http_utils'

    # authentication login listener for updating e-commerce framework environment after logout
# App\EventListener\AuthenticationLogoutListener:
# arguments:
# $httpUtils: '@security.http_utils'

    # ---------------------------------------------------------
    # Workflow
    # ---------------------------------------------------------
    App\Workflow\SupportsStrategy: ~

```

demo\_frontendセクションをコメントアウトまたは削除。

**`config/packages/security.yaml`**

```auto
security:
    firewalls:
        # demo_frontend: ---> delete this section
            ..........
            .............

```

* * *

**管理画面のファイルマネージャで必要のないコントローラも削除すること。**

* * *

### 不必要なコンポーネントを削除

**`composer.json`**

```auto
  "require": {
    "hwi/oauth-bundle": "^1.2.0", ---> delete
    "php-http/guzzle7-adapter": "^0.1.1",
    "php-http/httplug-bundle": "^1",
    "pimcore/customer-management-framework-bundle": "^3.0",---> delete
    "pimcore/data-hub": "^1.0",
    "pimcore/payment-provider-unzer": "^1.0",
    "pimcore/pimcore": "^10.0",
    "pimcore/web2print-tools-bundle": "^4.0",---> delete
    "symfony/google-mailer": "^5.3"
  },
  "conflict": {
    "hwi/oauth-bundle": "1.4.0"---> delete
  },

```

### アップデートとディレクトリ所有者修正

```auto
# COMPOSER_MEMORY_LIMIT=-1 composer update
# chown -R www-data:www-data ./

```

---

<div class="post-metadata">

### Author: ![tk-fuse](https://forum.ficusonline.com/user_avatar/forum.ficusonline.com/tk-fuse/32/255_2.png) [@tk-fuse](https://forum.ficusonline.com/u/tk-fuse)
#### Post date: [2022 年 3 月 20 日午後 2:20 UTC](https://forum.ficusonline.com/t/topic/378/7 "2022-03-20T14:20:27Z")

</div>

### Pimcore PHPコマンド

**`bin/console list`**

```auto
Usage:
  command [options] [arguments]

Options:
  -h, --help Display help for the given command. When no command is given display help for the list command
  -q, --quiet Do not output any message
  -V, --version Display this application version
      --ansi|--no-ansi Force (or disable --no-ansi) ANSI output
  -n, --no-interaction Do not ask any interactive question
      --ignore-maintenance-mode Set this flag to force execution in maintenance mode
      --maintenance-mode Set this flag to force maintenance mode while this task runs
  -e, --env=ENV The Environment name. [default: "prod"]
      --no-debug Switch off debug mode.
  -v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Available commands:
  about Display information about the current project
  completion Dump the shell completion script
  help Display help for a command
  list List commands
 app
  app:asset-copyright                        
  app:data-command                           
 assets
  assets:install Install bundle's web assets under a public directory
 cache
  cache:clear Clear the cache
  cache:pool:clear Clear cache pools
  cache:pool:delete Delete an item from a cache pool
  cache:pool:list List available cache pools
  cache:pool:prune Prune cache pools
  cache:warmup Warm up an empty cache
 config
  config:dump-reference Dump the default configuration for an extension
 dbal
  dbal:run-sql Executes arbitrary SQL directly from the command line.
 debug
  debug:autowiring List classes/interfaces you can use for autowiring
  debug:config Dump the current configuration for an extension
  debug:container Display current services for an application
  debug:dotenv Lists all dotenv files with variables and values
  debug:event-dispatcher Display configured listeners for an application
  debug:firewall Display information about your security firewall(s)
  debug:form Display form type information
  debug:messenger List messages you can dispatch using the message buses
  debug:router Display current routes for an application
  debug:translation Display translation messages information
  debug:twig Show a list of twig functions, filters, globals and tests
  debug:validator Display validation constraints for classes
 doctrine
  doctrine:database:create Creates the configured database
  doctrine:database:drop Drops the configured database
  doctrine:database:import Import SQL file(s) directly to Database.
  doctrine:migrations:current [current] Outputs the current version
  doctrine:migrations:diff [diff] Generate a migration by comparing your current database to your mapping information.
  doctrine:migrations:dump-schema [dump-schema] Dump the schema for your database to a migration.
  doctrine:migrations:execute [execute] Execute one or more migration versions up or down manually.
  doctrine:migrations:generate [generate] Generate a blank migration class.
  doctrine:migrations:latest [latest] Outputs the latest version
  doctrine:migrations:list [list-migrations] Display a list of all available migrations and their status.
  doctrine:migrations:migrate [migrate] Execute a migration to a specified version or the latest available version.
  doctrine:migrations:rollup [rollup] Rollup migrations by deleting all tracked versions and insert the one version that exists.
  doctrine:migrations:status [status] View the status of a set of migrations.
  doctrine:migrations:sync-metadata-storage [sync-metadata-storage] Ensures that the metadata storage is at the latest version.
  doctrine:migrations:up-to-date [up-to-date] Tells you if your schema is up-to-date.
  doctrine:migrations:version [version] Manually add and delete migration versions from the version table.
  doctrine:query:sql Executes arbitrary SQL directly from the command line.
 fos
  fos:js-routing:debug Displays currently exposed routes for an application
  fos:js-routing:dump Dumps exposed routes to the filesystem
 lint
  lint:container Ensure that arguments injected into services match type declarations
  lint:twig Lint a Twig template and outputs encountered errors
  lint:xliff Lint an XLIFF file and outputs encountered errors
  lint:yaml Lint a YAML file and outputs encountered errors
 messenger
  messenger:consume Consume messages
  messenger:setup-transports Prepare the required infrastructure for the transport
  messenger:stop-workers Stop workers after their current message
 pimcore
  pimcore:bundle:disable Disables a bundle
  pimcore:bundle:enable Enables a bundle
  pimcore:bundle:install Installs a bundle
  pimcore:bundle:list Lists all pimcore bundles and their enabled/installed state
  pimcore:bundle:uninstall Uninstalls a bundle
  pimcore:cache:clear Clear caches
  pimcore:cache:warming Warm up caches
  pimcore:classificationstore:delete-store [classificationstore:delete-store] Delete Classification Store
  pimcore:definition:import:class [definition:import:class] Import Class definition from a JSON export
  pimcore:definition:import:customlayout [definition:import:customlayout] Import Customlayout definition from a JSON export
  pimcore:definition:import:fieldcollection [definition:import:fieldcollection] Import FieldCollection definition from a JSON export
  pimcore:definition:import:objectbrick [definition:import:objectbrick] Import ObjectBrick definition from a JSON export
  pimcore:deployment:classes-rebuild [deployment:classes-rebuild] rebuilds db structure for classes, field collections and object bricks based on updated var/classes/definition_*.php files
  pimcore:deployment:custom-layouts-rebuild rebuilds db structure for custom layouts based on updated var/classes/customlayouts/definition_*.php files
  pimcore:documents:generate-page-previews Generates the previews shown in the tree on hover
  pimcore:documents:generate-static-pages Regenerate static pages
  pimcore:documents:migrate-elements Migrates document elements to editables. See issue https://github.com/pimcore/pimcore/issues/7384 first
  pimcore:email:cleanup [email:cleanup] Cleanup email logs
  pimcore:image:low-quality-preview [pimcore:image:svg-preview] Regenerates low quality image previews for all image assets
  pimcore:locale:delete-unused-tables Delete unused locale(invalid language) tables & views
  pimcore:maintenance [maintenance] Asynchronous maintenance jobs of pimcore (needs to be set up as cron job)
  pimcore:maintenance-mode Enable or disable maintenance mode
  pimcore:migrate:storage Migrate data from one storage to another
  pimcore:mysql-tools [mysql-tools] Optimize and warmup mysql database
  pimcore:recyclebin:cleanup Cleanup recyclebin entries
  pimcore:run-script Run a specific PHP script in an initialized Pimcore environment
  pimcore:search-backend-reindex [search-backend-reindex] Re-indexes the backend search of pimcore
  pimcore:system:requirements:check [system:requirements:check] Check system requirements
  pimcore:thumbnails:clear Clear certain image or video thumbnails (temp. files)
  pimcore:thumbnails:image [thumbnails:image] Generate image thumbnails, useful to pre-generate thumbnails in the background
  pimcore:thumbnails:optimize-images [thumbnails:optimize-images] Optimize filesize of all thumbnails
  pimcore:thumbnails:video [thumbnails:video] Generate video thumbnails, useful to pre-generate thumbnails in the background
  pimcore:user:reset-password [reset-password] Reset a user's password
  pimcore:workflow:dump Dump a workflow
 presta
  presta:sitemaps:dump Dumps sitemaps to given location
 router
  router:match Help debug routes by simulating a path info match
 secrets
  secrets:decrypt-to-local Decrypt all secrets and stores them in the local vault
  secrets:encrypt-from-local Encrypt all local secrets to the vault
  secrets:generate-keys Generate new encryption keys
  secrets:list List all secrets
  secrets:remove Remove a secret from the vault
  secrets:set Set a secret in the vault
 security
  security:encode-password Encode a password
  security:hash-password Hash a user password
 translation
  translation:extract [translation:update] Extract missing translations keys from code to translation files.
  translation:pull Pull translations from a given provider.
  translation:push Push translations to a given provider.

```

**ex)**

```auto
# bin/console messenger:consume --memory-limit=128M
# bin/console pimcore:maintenance --async
# bin/console messenger:consume pimcore_core pimcore_maintenance --time-limit=300 
# bin/console doctrine:migrations:list
# bin/console debug:router

```

---

<div class="post-metadata">

### Author: ![tk-fuse](https://forum.ficusonline.com/user_avatar/forum.ficusonline.com/tk-fuse/32/255_2.png) [@tk-fuse](https://forum.ficusonline.com/u/tk-fuse)
#### Post date: [2022 年 3 月 21 日午後 12:25 UTC](https://forum.ficusonline.com/t/topic/378/8 "2022-03-21T12:25:54Z")

</div>

### パフォーマンスガイド

`Document -> Settings -> Static Page Generator`

### Static-Page-Generator

[https://pimcore.com/docs/pimcore/current/Development\_Documentation/Installation\_and\_Upgrade/System\_Setup\_and\_Hosting/Performance\_Guide.html#page\_Static-Page-Generator](https://pimcore.com/docs/pimcore/current/Development_Documentation/Installation_and_Upgrade/System_Setup_and_Hosting/Performance_Guide.html#page_Static-Page-Generator)

Pimcore offers a **static page generator** service, which generates static HTML files out of pages (documents). These static files can be delivered directly by Apache/Nginx instead of going through complete PHP driven MVC cycle on a frontend request. **This feature is not recommended for a page with dynamic content i.e. news listing, product pages, and so on, where content changes frequently**.

### Pimcore Caching (Redis)

[https://pimcore.com/docs/pimcore/current/Development\_Documentation/Installation\_and\_Upgrade/System\_Setup\_and\_Hosting/Performance\_Guide.html#page\_Pimcore-Caching-Redis](https://pimcore.com/docs/pimcore/current/Development_Documentation/Installation_and_Upgrade/System_Setup_and_Hosting/Performance_Guide.html#page_Pimcore-Caching-Redis)

---

<div class="post-metadata">

### Author: ![tk-fuse](https://forum.ficusonline.com/user_avatar/forum.ficusonline.com/tk-fuse/32/255_2.png) [@tk-fuse](https://forum.ficusonline.com/u/tk-fuse)
#### Post date: [2022 年 3 月 23 日午前 6:53 UTC](https://forum.ficusonline.com/t/topic/378/9 "2022-03-23T06:53:32Z")

</div>

### サードパーティ製バンドルの追加について

[https://pimcore.com/docs/pimcore/current/Development\_Documentation/Extending\_Pimcore/Add\_Your\_Own\_Dependencies\_and\_Packages.html#page\_Third-party-bundles](https://pimcore.com/docs/pimcore/current/Development_Documentation/Extending_Pimcore/Add_Your_Own_Dependencies_and_Packages.html#page_Third-party-bundles)

**`composer.json`** にバンドルを追加してアップデートするか、以下コマンドでインストール

```auto
# composer require mtdowling/cron-expression

```

**`src/Kernel.php`**

```auto
<?php

namespace App;

use Pimcore\HttpKernel\BundleCollection\BundleCollection;
use Pimcore\Kernel as PimcoreKernel;

class Kernel extends PimcoreKernel
{
    /**
     * Adds bundles to register to the bundle collection. The collection is able
     * to handle priorities and environment specific bundles.
     *
     * @param BundleCollection $collection
     */
    public function registerBundlesToCollection(BundleCollection $collection)
    {
        if (class_exists('\\XYZBundle\\XYZBundle')) {
            $collection->addBundle(new \XYZBundle\XYZBundle);
        }

        // add a custom third-party bundle here with a high priority and only for dev environment
        $collection->addBundle(new Third\Party\PartyBundle, 10, ['dev']);
    }
}

```

---

<div class="post-metadata">

### Author: ![tk-fuse](https://forum.ficusonline.com/user_avatar/forum.ficusonline.com/tk-fuse/32/255_2.png) [@tk-fuse](https://forum.ficusonline.com/u/tk-fuse)
#### Post date: [2024 年 1 月 11 日午前 5:17 UTC](https://forum.ficusonline.com/t/topic/378/10 "2024-01-11T05:17:03Z")

</div>

Docker ImageについてはGitHubでも配布

> **[GitHub - pimcore/docker: PHP docker images optimized for running Pimcore](https://github.com/pimcore/docker)**
>
> PHP docker images optimized for running Pimcore

- [`min`] PHP image for FPM and CLI with minimum requirements (e.g. `php8.2-min-latest`)
- [`default`] PHP image for FPM and CLI incl. all optional dependencies (e.g. `php8.2-latest` or `php8.2-default-latest`)
- [`max`] PHP image for FPM and CLI incl. all optional dependencies and additional extensions and software (e.g. `php8.2-max-latest`)
- [`debug`] PHP debug image based on PHP image above, including preconfigured Xdebug for FPM and CLI (e.g. `php8.2-debug-latest`)
- [`supervisord`] Supervisord image based on PHP image above, for cron & queue processing (e.g. `php8.2-supervisord-latest`)

従来の **PHP8.1-fpm** イメージは **php8.1-latest** （defaultの場合）となります。

```auto
$ docker pull pimcore/pimcore:php8.1-latest

```

---

<div class="post-metadata">

### Author: ![tk-fuse](https://forum.ficusonline.com/user_avatar/forum.ficusonline.com/tk-fuse/32/255_2.png) [@tk-fuse](https://forum.ficusonline.com/u/tk-fuse)
#### Post date: [2024 年 1 月 11 日午後 3:22 UTC](https://forum.ficusonline.com/t/topic/378/11 "2024-01-11T15:22:11Z")

</div>

## How to use Symfony Messenger with Pimcore?

> **[How to use Symfony Messenger with Pimcore? | pimcore.com](https://pimcore.com/en/resources/blog/how-to-use-symfony-messenger-with-pimcore_a309177)**
>
> Don’t waste your time waiting - let Symfony Messenger do the job in the background in your Pimcore application.

> **[Messenger: Sync & Queued Message Handling (Symfony Docs)](https://symfony.com/doc/current/messenger.html)**
>
> Messenger provides a message bus with the ability to send messages and then handle them immediately in your application or send them through transports (e.g. queues) to be handled later. To learn more…
