Docker-compose.yml
in the official repository builds Dockerfile
at first startup to create a container image. So if you have the EC-CUBE plugin in composer.json
, it will (probably) stop at composer install
as described in Dockerfile
. Therefore, consider how to build an environment without using the official docker-compose.yml
.vendor
directory as well, so I built it with this procedure.4.0.5
.docker-compose.yml
to proceed with the work. This time, the following sample is assumed.version: '3'
services:
web:
image: xxxx
container_name: container-web
working_dir: /var/www/vhosts/your_project/app
volumes:
- ../app:/var/www/vhosts/your_project:delegated
- /var/www/vhosts/your_project/app/codeception
- /var/www/vhosts/your_project/app/dockerbuild
- /var/www/vhosts/your_project/app/gulp
- /var/www/vhosts/your_project/app/node_modules
- /var/www/vhosts/your_project/app/tests
- /var/www/vhosts/your_project/app/var/cache
- /var/www/vhosts/your_project/app/var/log
- /var/www/vhosts/your_project/app/var/sessions
- /var/www/vhosts/your_project/app/zap
ports:
- '80:80'
your_workspace − your_project − docker/docker-compose.yml
∟ app
cd your_workspace/your_project/app
git clone -b 4.0 --depth 1 https://github.com/EC-CUBE/ec-cube.git .
rm -rf .git
cp -ap .env.dist .env
vi .env
cd your_workspace/your_project/docker
docker-compose up -d
docker-compose exec --user apache web composer install --no-scripts --no-autoloader
docker-compose exec --user apache web composer dumpautoload
#Change permissions and ownership of directories used for cache and log output
docker-compose exec web chown -R apache:apache ./var
docker-compose exec web chmod -R 777 ./var
# EC-CUBE initialization
docker-compose exec --user apache web ./bin/console eccube:install
eccube: install
, it is internally equivalent to the following.# (optional)Database deletion
# bin/console doctrine:database:drop --force
#Database creation
# bin/console doctrine:database:create
# (optional)Schema deletion
# bin/console doctrine:schema:drop --force
#Schema generation
# bin/console doctrine:schema:create
#Initial data generation
# bin/console eccube:fixtures:load
EC-CUBE 4.0 Developer Document Site> Installation Method> When Using Windows Environment
docker-compose exec --user apache web ./bin/console cache:warmup
: point_up_tone2: When clearing the cache
docker-compose exec --user apache web ./bin/console cache:clear --no-warmup
It's OK if you open http: // localhost
and see the default shop.
: no_entry_sign: The URL depends on the docker image you used.
cd your_workspace/your_project/app
cp -ap .env.dist .env
vi .env
cd your_workspace/your_project/docker
docker-compose up -d
docker-compose exec --user apache web composer install --no-scripts --no-autoloader
docker-compose exec --user apache web composer dumpautoload
#Change permissions and ownership of directories used for cache and log output
docker-compose exec web chown -R apache:apache ./var
docker-compose exec web chmod -R 777 ./var
# EC-CUBE initialization
docker-compose exec --user apache web ./bin/console eccube:install
docker-compose exec --user apache web ./bin/console cache:warmup
: point_up_tone2: When clearing the cache
docker-compose exec --user apache web ./bin/console cache:clear --no-warmup
It's OK if you open http: // localhost
and see the default shop.
: no_entry_sign: The URL depends on the docker image you used.
cd your_workspace/your_project/app
cp -ap .env.dist .env
vi .env
cd your_workspace/your_project/docker
docker-compose up -d
If you have the EC-CUBE plug-in installed, you can find information about the EC-CUBE plug-in in composer.json
and composer.lock
. The sales aggregation plugin is ec-cube/SalesReport4
.
You can't do composer install
as it is ...: sob:
To avoid this, prepare the original composer.json
and composer.lock
of the EC-CUBE version you are using and execute the command.
docker-compose exec --user apache -e COMPOSER=composer_4.0.5.json web composer install --no-scripts --no-autoloader
docker-compose exec --user apache web composer dumpautoload
COMPOSER
to execute the command by specifying the JSON file.
In the above case, the file name of the lock file is composer_4.0.5.lock
.#Change permissions and ownership of directories used for cache and log output
docker-compose exec web chown -R apache:apache ./var
docker-compose exec web chmod -R 777 ./var
# EC-CUBE initialization
docker-compose exec --user apache web ./bin/console eccube:install
In my case, the authentication key is prepared for each case (development environment, staging environment, production environment are the same), so set the authentication key obtained in the environment installed first here.
update dtb_base_info set authentication_key='your_authentication_key';
docker-compose exec --user apache web ./bin/console eccube:composer:install
There is also another command, ./bin/console eccube: composer: require-already-installed
.
Since it is require
, there is a possibility that a version different from composer.lock
will be included, so I did not use it here.
eccube: composer: install
does not refer to the dtb_plugin
table, and eccube: composer: require-already-installed
refers to the dtb_plugin
table.
There seems to be a difference.
docker-compose exec --user apache web ./bin/console eccube:plugin:enable --code=SalesReport4
SalesReport4
and execute it.docker-compose exec --user apache web ./bin/console cache:warmup
: point_up_tone2: When clearing the cache
docker-compose exec --user apache web ./bin/console cache:clear --no-warmup
It's OK if you open http: // localhost
and see the default shop.
: no_entry_sign: The URL depends on the docker image you used.
Recommended Posts