Sign inSign up

graillus/php-symfony

By graillus

•Updated over 8 years ago

Docker development environment ready for Symfony Flex projects.

Image
1

203

graillus/php-symfony repository overview

⁠docker-symfony

Docker development environment ready for Symfony Flex projects.

⁠Features

  • php-fpm (alpine)
  • nginx (alpine)
  • composer
  • Xdebug
  • Blackfire

⁠Requirements

  • Recent version of docker and docker-compose
  • An existing symfony installation :
docker run -it --rm -v $(pwd):/app composer:latest composer create-project symfony/skeleton .

⁠Installation

  • Clone the repository
git clone [email protected]:graillus/docker-symfony.git
cd docker-symfony
  • Copy all files to target project root
cp -R * .* /path/to/project

⁠Usage

In your project root directory, just build and lauch the containers:

docker-compose build
docker-compose up -d

⁠Xdebug

If you want to use Xdebug remote debugging, you need to configure the Xdebug remote host.

Edit the docker-compose.yaml file :

    php-fpm:
      ...
      environment:
        XDEBUG_CONFIG: remote_host=172.20.0.1 # IP shown in the symfony profiler

Now configure your IDE with the following parameters:

  • IDE key: idekey
  • host: localhost
  • port: 80
  • debugger: Xdebug

Map your local project directory to /var/www/app on the remote.

Restart the containers and start listening for debug connections.

⁠Blackfire

To enable blackfire agent, uncomment the blackfire service definition in the docker-compose.yaml file.

Don't forget to define the required environment variables or add them to your .env file so the blackfire agent/client gets the right credentials.

Read the blackfire documentation⁠ for more details.

⁠License

WTFPL v2

WTFPL v2

See the LICENSE file.

Tag summary

Content type

Image

Digest

Size

66.8 MB

Last updated

over 8 years ago

docker pull graillus/php-symfony