EC-CUBE / EC-CUBE/ec-cube

docker-composeのインストールは失敗する

Open
#4,811 9 comments 0 reactions 0 assignees View on GitHub
Status: discussion
Dominant language
PHP
Stars
788
Forks
719
Avg merge
4d 4h
Merged PRs (30d)
39

Description

## 概要(Overview)

ドキュメント通りに`docker-compose`のインストールを行っても、インストールできません。

## 期待する内容(Expect) or 要望 (Requirement)

インストールが完了すること

## 再現手順(Procedure)

`git clone https://github.com/EC-CUBE/ec-cube.git`
`cd ec-cube`
`cp .env.dist .env`
`docker-compose up -d`

そして、

`docker-compose exec ec-cube composer install`

を実行しても・しなくても、次に

`docker-compose exec -u www-data ec-cube bin/console eccube:install`

を実行すると、次のように失敗します:

```
EC-CUBE Installer Interactive Wizard
====================================

If you prefer to not use this interactive wizard, define the environment valiables as follows:

$ export APP_ENV=prod
$ export APP_DEBUG=0
$ export DATABASE_URL=database_url
$ export DATABASE_SERVER_VERSION=server_version
$ export MAILER_URL=mailer_url
$ export ECCUBE_AUTH_MAGIC=auth_magic
... and more
$ php bin/console eccube:install --no-interaction

Database Url [sqlite:///var/eccube.db]:
>

Mailer Url [null://localhost]:
>

Auth Magic [...]:
>

!
! [CAUTION] Execute the installation process. All data is initialized.
!

Is it OK? (yes/no) [yes]:
>

Run doctrine:database:create...
Created database var/eccube.db for connection named default

Run doctrine:schema:drop --force...

Dropping database schema...

[OK] Database schema dropped successfully!

Run doctrine:schema:create...

! [CAUTION] This operation should not be executed in a production environment!

Creating database schema...

[OK] Database schema created successfully!

Run eccube:fixtures:load...

[ERROR] The command "bin/console eccube:fixtures:load" failed.

Exit Code: 1(General error)

Working directory: /var/www/html

Output:
================

Error Output:
================
23:41:16 ERROR [console] Error thrown while running command "eccube:fixtures:load". Message: "Failed to
create "/var/www/html/html/user_data/assets/img/common": mkdir(): Permission denied" ["exception" =>
Symfony\Component\Filesystem\Exception\IOException { …},"command" => "eccube:fixtures:load","message" =>
"Failed to create "/var/www/html/html/user_data/assets/img/common": mkdir(): Permission denied"] ["file" =>
"/var/www/html/vendor/symfony/console/EventListener/ErrorListener.php","line" => 48,"class" =>
"Symfony\Component\Console\EventListener\ErrorListener","function" => "onConsoleError","uid" =>
"d15d6e2","user_id" => "N/A","session_id" => "N/A"]

In Filesystem.php line 104:

Failed to create "/var/www/html/html/user_data/assets/img/common": mkdir():
Permission denied

eccube:fixtures:load [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi]
[-n|--no-interaction] [-e|--env ENV] [--no-debug] [--]

```

これは権限の問題だと思います。なぜなら、`www-data`ではなく`root`として

`docker-compose exec ec-cube bin/console eccube:install`

を実行すれば、` [OK] EC-CUBE installation successful.`まで進むことできます。
なのに、ドキュメントに`# 初回はインストールスクリプトを実行( **`www-data` ユーザで実行する点に注意!** )`と書いてあります。

### 環境 (environment)
+ EC-CUBE: 4.0.5 ( https://github.com/EC-CUBE/ec-cube/commit/271a4c80bcd7ad623f0a6e1986d00c70f0ce0121 )
+ PHP: (`dockerfile`と同じ)
+ DB: (`dockerfile`と同じ)
- PostgreSQL 10
- MySQL 5.7

## 関連情報 (Ref)

* [EC-CUBE 4.0 開発者向けドキュメント > インストール方法 > 4.Docker Composeを使用してインストールする](https://doc4.ec-cube.net/quickstart_install#4docker-compose%E3%82%92%E4%BD%BF%E7%94%A8%E3%81%97%E3%81%A6%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E3%81%99%E3%82%8B)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.