Sylius/etc/docker
2016-03-16 14:55:42 +01:00
..
nginx A Docker Compose configuration to develop in Docker containers. 2016-01-27 16:34:08 +01:00
php Using default.conf as php docker container pool 2016-03-16 14:55:42 +01:00
docker-compose.yml Docker improvements: 2016-03-16 14:43:09 +01:00
README.md A Docker Compose configuration to develop in Docker containers. 2016-01-27 16:34:08 +01:00

Description

This Docker Compose development environment includes

  • PHP 7.0
  • MariaDB
  • Nginx
  • Composer

Usage

First you need to install Docker and Docker Compose.

cd docker
docker-compose up

Now you have a few options to get started

Basic

Get the ip of the Nginx container.

docker inspect $(docker-compose ps -q nginx) | grep IPAddress

Advanced

Run a dnsdock container before docker-compose up, more info: https://github.com/tonistiigi/dnsdock Access the containers from the dns records.

Troubleshooting

How to enter a container?

Enter the php container to install composer vendors etc.

docker exec -it $(docker-compose ps -q php) bash

The application is too slow.

Install composer vendors in the container and symlink them to the application directory. Execute inside the php container:

mkdir /vendor && ln -sf /vendor ./vendor

Using Symfony2 inside Vagrant can be slow due to synchronisation delay incurred by NFS. You can write the app logs and cache to a folder on the php container.

Enter the php container and create the directory:

docker exec -it $(docker-compose ps -q php) bash
mkdir /dev/shm/sylius/
setfacl -R -m u:"www-data":rwX -m u:`whoami`:rwX /dev/shm/sylius/
setfacl -dR -m u:"www-data":rwX -m u:`whoami`:rwX /dev/shm/sylius/

To view the application logs, run the following commands:

tail -f /dev/shm/sylius/app/logs/prod.log
tail -f