cd /var/www
git clone [email protected]:alpin11/traefik-docker.git
cd traefik-docker
docker network create traefik # this will create network
docker-compose up -d
cd /var/www
mkdir <projectdir>
sudo chown `whoami`:www-data <projectdir> -R
sudo setfacl -R -m u:www-data:rwx -m g:www-data:rwx <projectdir>
sudo setfacl -dR -m u:www-data:rwx -m g:www-data:rwx <projectdir>
sudo chmod -R g+s /var/www/<projectdir>
cd <projectdir>
git init
git remote add origin <origin> # example: [email protected]:alpin11/royal-filter-pimcore.git
git pull
git checkout master # or development branch in BT case
docker-compose up -d
docker exec -it <projectname-php> bash # php container name - (stocker-php or stocker-php-debug)
composer install
exit
cd /var/www/<projectdir>
sudo setfacl -R -m user:`whoami`:rwX -m mask:rwX .
sudo setfacl -dR -m user:`whoami`:rwX -m mask:rwX .
cd /var/www/html
setfacl -R -m user:33:rwX -m mask:rwX .;
setfacl -dR -m user:33:rwX -m mask:rwX .;
setfacl -R -m user:100:rwX ./public;
setfacl -dR -m user:100:rwX ./public;
setfacl -R -m user:100:rwX ./var;
setfacl -dR -m user:100:rwX ./var;
Create .env
file from .env_example
file and Copy .env.docker
to .env.docker.local
in local file is necessary to enabled debug so PHP_DEBUG=1
go var/config
create debug-mode.php
with content of
<?php
return [
"active" => TRUE,
"ip" => "",
"devmode" => TRUE
];
./vendor/bin/pimcore-install \
--admin-username=admin \
--admin-password=admin \
--mysql-host-socket=royal-filter-db \
--mysql-username=pimcore \
--mysql-password=pimcore \
--mysql-database=pimcore \
--ignore-existing-config
now project should be running under traefik url defined in docker-compose.yml in webserver section
royal-filter.local-127-0-0-1.nip.io - for normal without debug mode enabled
royal-filter-debug.local-127-0-0-1.nip.io - for debug mode enabled
pimcore install is creating DB itself so this is just commands to handle existing DB from devel/production
run docker exec -i royal-filter-mysql mysqldump --host=<IP> --user=dumper --password <DBNAME> --skip-add-locks --skip-comments --single-transaction --no-create-db --no-tablespaces | sed -e 's/DEFINER[ ]*=[ ]*[^*]*\*/\*/' > ~/Downloads/royal-filter_database.dump
- there is dumper password necessary
run docker exec -i royal-filter-mysql mysqldump --host=localhost --user=pimcore --password pimcore --skip-add-locks --skip-comments --single-transaction --no-create-db --no-tablespaces --ignore-table=pimcore.object_localized_cs_product_de | sed -e 's/DEFINER[ ]*=[ ]*[^*]*\*/\*/' > /var/www/bordel/royal-filter_database.dump
run docker exec -i royal-filter-mysql mysql -upimcore -ppimcore pimcore < royal-filter_database.dump
Clear caches: rm -rf var/cache; php bin/console cache:clear; php bin/console pimcore:cache:clear;
Change admin password inside PHP docker container: php bin/console pimcore:user:reset-password admin
Rebuild classes: php bin/console pimcore:deployment:classes-rebuild -c -d
Install assets: php bin/console assets:install web --symlink --relative
Install for Chrome Headless -> https://stackoverflow.com/questions/67407104/error-while-loading-shared-libraries-libgbm-so-1-cannot-open-shared-object-fil
If is create/drop database not working because of permissions then is necessary:
- stop containers
- save actual db to dump or download production db dump to local
- remove or move folder
var/mysql-data
- run containers - will initialize multiple databases and setup correct rights on created db
- done