Compose Pimcore
- Project website:
- pimcore.org
- Github:
- https://github.com/dockerwest/compose-pimcore
Getting started
Make sure you first followed the global getting started steps.
1. Clone the git repository next to your project folder.
$ git clone git@github.com:dockerwest/compose-pimcore.git
2. Copy .env-sample to .env and update accordingly
Set the relative path to the folder where your project is located:
APPLICATION=../pimcore
3. Start the project-specific environment
$ ./environment
4. Start the docker environment
$ run up
The helper command run
is an alias to docker-compose
, specific
for the current environment.
5. Access your project in the browser
This can be done in one of the following ways:
- Use Docker Developer DNS
This way you can access the environment by browsingpimcore.docker
in your browser. - Use Nginx Proxy
This way you can access the environment by browsingpimcore.docker
in your browser. - Add
ports
section to the nginx config in the docker-composer.yml file:nginx: ports: - "80:80"
This way you can access the environment by browsinglocalhost:80
in your browser.
What's in the box?
The following technologies are out-of-the-box available in this environment.
Click on one of the names for more information.
php-pimcore image named application
,
which mounts the APPLICATION
path to the image and links to mysql, redis and
mailcatcher.
You can access the php-cli using the php
helper. (see below)
The following packages are installed: php-cli php-fpm php-curl php-json php-zip php-gd php-mysql php-mcrypt php-sqlite3 php-bz2 php-xml php-mbstring php-zip php-redis php-memcached php-imagick php-intl imagemagick inkscape pngnq pngcrush xvfb cabextract poppler-utils xz-utils libreoffice libreoffice-math jpegoptim ffmpeg html2text ghostscript exiftool xfonts-75dpi wkhtmltopdf
nginx-pimcore image named
nginx
,
which mounts the APPLICATION
path to the image and links to application.
This nginx container is available at pimcore.docker
and www.pimcore.docker
through
- VIRTUAL_HOST=${BASEHOST:-pimcore.docker},www.${BASEHOST:-pimcore.docker}
Redis image named redis
.
This redis container is available at redis.pimcore.docker
through
- DOMAIN_NAME=redis.${BASEHOST:-pimcore.docker}
Connection settings:
host: redis
Mysql image named mysql
.
The mysql root password is provided through the environment variable in the .env
file
through:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-toor}
This mysql container is available at mysql.pimcore.docker
through
- DOMAIN_NAME=mysql.${BASEHOST:-pimcore.docker}
You should first create a new database through the create_db
helper command (see below).
Connection settings:
host: mysql port: 3306 user: root password: toor (unless changed in .env file)
Mailcatcher container named
mailcatcher
.
This mailcatcher container is available at mailcatcher.pimcore.docker:1080
through
- DOMAIN_NAME=mailcatcher.${BASEHOST:-pimcore.docker}
SMTP settings for your application are:
host: mailcatcher port: 1025
Available helper commands
Click on one of the commands for more info and an example.
$ run up
Execute the php command inside the running php container, or inside a php-pimcore container if none is running.
The working directory will be the current directory you are executing this command from.
eg.$ php -v
Run the composer command inside the php docker container. The working directory will be the current directory you are executing this command from.
Your $HOME/.ssh and $HOME/.composer folders wil be mounted inside this container to enable you to make use of your ssh keys and composer cache.
eg.$ composer require package_name
Create a new database inside the running mysql container with the given name (eg. 'pimcore') and 'DEFAULT CHARSET utf8'.
eg.$ create_db pimcore
Execute a mysql command inside the running mysql container as the root user.
eg.$ mysql "SELECT * FROM table_name;"
Execute the mysqldump command inside the running mysql container as the root user.
eg.$ mysqldump db_name > export_file_name.sql
Import a given mysql file into a given database, inside the running mysql container as the root user.
eg.$ mysqlimport db_name import_file_name.sql
Execute the nodejs command inside a nodejs container. The working directory will be the current directory you are executing this command from.
eg.$ node js_file.js
Execute the npm command inside a nodejs container.
The working directory will be the current directory you are executing this command from. Your $HOME/.ssh and $HOME/.npm folders wil be mounted inside this container to enable you to make use of your ssh keys and npm cache.
eg.$ npm install package_name
Execute the yarn command inside a nodejs container.
The working directory will be the current directory you are executing this command from. Your $HOME/.ssh and $HOME/.npm folders wil be mounted inside this container to enable you to make use of your ssh keys and npm cache.
eg.$ yarn add package_name