Docker version of the great PyroCMS.
- Install Docker
- Install Docker Compose
- Gets familiar with Docker and Docker Compose (command line, options, docs). There is a great documentation in this repository
Note: in order to use this stack you must install Docker Compose 1.10+
- httpd 2.4.6
- PHP 7.1.1 (php-fpm)
- MariaDB (latest)
- PyroCMS 3.2.2
- Create a copy of
.env.dist
or rename.env.dist
to.env
:
$ cp .env.dist .env
- Open the file
.env
and update the values as desired
- Create a copy of
docker/php-fpm/container-files/tmp/.env.dist
:
$ cp docker/php-fpm/container-files/tmp/.env.dist docker/php-fpm/container-files/tmp/.env
- Open the file
.env
and update the values as desired
This is an example of the default values used:
APP_ENV=local
APP_DEBUG=true
APP_KEY=zfesbnTkXvooWVcsKMw2r4SmPVNGbFoS
DB_DRIVER=mysql
DB_HOST=db
DB_DATABASE=pyrocms
DB_USERNAME=root
DB_PASSWORD=1qazxsw2
APPLICATION_NAME=Default
APPLICATION_REFERENCE=default
APPLICATION_DOMAIN=localhost
ADMIN_EMAIL=test@email.com
ADMIN_USERNAME=admin
ADMIN_PASSWORD=1qazxsw2
LOCALE=en
TIMEZONE=UTC
Note: if you've changed values for MySQL service at .env file then you need to change DB_DATABASE, DB_USERNAME and DB_PASSWORD at PyroCSM .env file
By default the php-fpm
image ships with latest Composer installed but you can enable the following PHP extensions:
- Xdebug
- Mongo
- Redis
- Extended HTTP
- Upload Progress
- Extended Attributes
For example to enable Xdebug, open the file .env
and change the ARG
to true
:
INSTALL_XDEBUG: "true"
The next time you run the command docker-compose up -d --build --force-recreate
the new image will ship with Xdebug installed and enabled
By default this stack is not persisting data so on each start|build you will have a clean instance of PyroCMS without any previous changes. If you want to persist data then setup the docker-compose.yml
file as follow:
db:
image: mariadb
healthcheck:
test: "exit 0"
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: ${MYSQL_DATABASE}
MYSQL_USER: ${MYSQL_USER}
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
volumes:
- sql-data:/var/lib/mysql
volumes:
sql-data:
external: true
- Run the following command:
$ docker-compose up -d --build --force-recreate
The installation take a while, if you're impatient and want to know what's happening then take a look to the logs:
# Show the logs from all containers
$ docker-compose logs -f
# Show the logs from php-fpm
$ docker logs -f dockerpyrocms_php-fpm_1
# Show the logs from httpd
$ docker logs -f dockerpyrocms_httpd_1
- The name
pyrocms.local
should be added to the hosts files pointing tolocalhost
or127.0.0.1
for the application to work properly.
- Open your preferred browser and type:
http://pyrocms.local/