Simple and easy Docker-Compose configuration for Pimcore 5 and Pimcore 6.
Docker-Compose consists of the following images:
- Redis
- MariaDB 10.4
- httpd (Apache 2.4) & PHP-FPM with PHP7.2 and all Pimcore required dependencies (LibreOffice, FFMPEG, Image Libraries, etc)
- PHP-FPM with PHP7.2 and all Pimcore required dependencies (LibreOffice, Image Libraries, etc) (except FFMPEG)
Credit to Dominik, this repo was bases off of Dominik's pimcore-docker-compose.
- git
- docker
- docker-compose
https://www.hanselman.com/blog/HowToSetUpDockerWithinWindowsSystemForLinuxWSL2OnWindows10.aspx
When composing the pimcore stacks make sure you are running it from your Linux distro, the Windows file system does not play nice with this install (it takes forever so install and download the files and the install will not be successful). There will also be performance improvements running on WSL.
git clone https://github.com/dpfaffenbauer/pimcore-docker-compose.git
cd pimcore-docker-compose/
# initialize and startup containers
docker-compose up -d
Choose which package to install
# get shell in running container
docker exec -it pimcore-skeleton-php bash
# inside pimcore-skeleton-php container
# get code
COMPOSER_MEMORY_LIMIT=-1 composer create-project pimcore/skeleton tmp-skeleton
# move code
mv tmp-skeleton/.[!.]* .
mv tmp-skeleton/* .
rmdir tmp-skeleton
#increase the memory_limit to >= 512MB as required by pimcore-install
echo 'memory_limit = 512M' >> /usr/local/etc/php/conf.d/docker-php-memlimit.ini;
service apache2 reload
#run installer, if you need to reinstall you can add --ignore-existing-config
./vendor/bin/pimcore-install --admin-username admin --admin-password admin --mysql-host-socket=db-skeleton --mysql-username=pimcore-skeleton --mysql-password=pimcore-skeleton --mysql-database=pimcore-skeleton --no-interaction --ignore-existing-config
# fix permissions
chown www-data: . -R
exit
# get shell in running container
docker exec -it pimcore-demo-php bash
# inside pimcore-demo-php container
# get code
COMPOSER_MEMORY_LIMIT=-1 composer create-project pimcore/demo tmp-demo
# move code
mv tmp-demo/.[!.]* .
mv tmp-demo/* .
rmdir tmp-demo
#increase the memory_limit to >= 512MB as required by pimcore-install
echo 'memory_limit = 512M' >> /usr/local/etc/php/conf.d/docker-php-memlimit.ini;
service apache2 reload
#run installer, if you need to reinstall you can add --ignore-existing-config
./vendor/bin/pimcore-install --admin-username admin --admin-password admin --mysql-host-socket=db-demo --mysql-username=pimcore-demo --mysql-password=pimcore-demo --mysql-database=pimcore-demo --no-interaction --ignore-existing-config
# fix permissions
chown www-data: . -R
exit
After the installer is finished, you can open in your Browser:
- Frontend: http://localhost:2000
- Backend: http://localhost:2000/admin
- Frontend: http://localhost:2010
- Backend: http://localhost:2010/admin
On some machines docker has problems with the relative symlinked (static) files. Run those commands in your pimcore-php
container
docker-compose exec php bash
chown www-data: . -R
This could take a while because of the amount of files inside the directory (especially because of the vendor
folder). There is no guarantee that those commands on all machines and operating systems.