Simple Dockerized Environment for Pimcore.
This project is based on Pimcore Skeleton.
Pimcore Skeleton Project Structure
pimcore-demo
+- app
| +- config
| | +- local
| | | +- database.yml <--- DB Info
| | +- ...
| | +- config.yml <--- App Config
| | +- ...
| +- Resources
| | +- views
| | +- Default
| | +- default.html.php <--- Default View
| +- ...
+- bin
+- src
| +- AppBundle
| +- ...
| +- Controller
| | +- DefaultController.php <--- Default Controller
| +- ...
+- var
| +- ...
| +- classes
| +- ...
| +- definition_[YOUR_CLASS].php <--- Class Definition
| +- logs
| +- dev.log
+- vendor
+- web <--- Root for Apache or NGINX
+- .editorconfig
+- .env.example
+- .gitattributes
+- .gitignore
+- .php_cs.dist
+- composer.json
+- composer.lock
+- docker-compose.yml
+- gpl-3.0.txt
+- README.md
Tip: run the following for Mac user to install Composer
brew install composer
# install PHP dependencies
composer install --ignore-platform-reqs
# start docker compose
docker-compose up -d
# run pimcore installer
docker-compose run --rm php vendor/bin/pimcore-install --mysql-host-socket db \
--admin-username admin --admin-password admin \
--mysql-username pimcore --mysql-password pimcore \
--mysql-database pimcore --no-interaction
# fix permission
docker-compose run --rm php chown -R www-data:www-data var/*
Access respectively:
- Pimcore: http://127.0.0.1
- Pimcore Admin: http://127.0.0.1/admin
- Adminer: http://127.0.0.1:8080
# pause: keep all data
docker-compose stop
# start from pause
docker-compose start
Pimcore offers 4 different installation packages, 3 demo packages and one skeleton for experienced developers. Check the link below:
https://pimcore.com/docs/6.x/Development_Documentation/Getting_Started/Installation.html#page_Choose-a-package-to-install
-
Remove all files except for the following
- README.md
- .git
- .gitignore
- .gitattributes
-
Download Pimcore package
COMPOSER_MEMORY_LIMIT=-1 composer create-project pimcore/skeleton tmp --ignore-platform-reqs
-
Move Pimcore project 1 hierachy up
rm -rf tmp/README.md tmp/.gitignore tmp/.gitattributes mv tmp/*(DN) ./ rm -rf tmp
-
Run Installer
# Run Docker docker-compose up -d # pimcore install docker-compose run --rm php vendor/bin/pimcore-install --mysql-host-socket db \ --admin-username admin --admin-password admin \ --mysql-username pimcore --mysql-password pimcore \ --mysql-database pimcore --no-interaction # fix permission docker-compose run --rm php chown -R www-data:www-data var/*
-
Check on Brower at
http://127.0.0.1/admin
with admin credential you set up right above--admin-username
and--admin-password
docker exec -it pimcore-php bash
-
Go into docker container
docker exec -it pimcore-php bash
-
Login to DB (no space after -p)
mysql -u pimcore -p'pimcore' -h database -P 3306 -D pimcore
# removes containers and default network, but preserves your Pimcore database
docker-compose down
# removes containers, default network, and Pimcore database
docker-compose down --volumes
# check volumes
docker volume ls
# remove all unused volumes
docker volume prune