Sign inSign up

bbpdev/symfony

By bbpdev

•Updated over 8 years ago

Symfony PHP 7.0 & 7.1 containers with Composer & optional XDebug

Image
0

7.0K

bbpdev/symfony repository overview

⁠Symfony basic Docker container

This uses PHP-fpm to provide a basic PHP container with Composer that will work for Symfony.

If you need more extensions installed you can either create your own Dockerfile or make more versions of this image so that we can have more options.

The images are version controlled with the semantic version number at the end of the tag so we don't accidentally break existing applications as they evolve.

The existing unversioned images will be kept around for a while, but should be considered deprecated and liable to be removed.

⁠PHP extensions installed

  • PDO
  • BC Math

⁠With Xdebug

An image of each version is available with Xdebug and these have been tested to work with recent versions of Docker and PhpStorm on Linux.

You will need to...

Set up a Docker host in Settings / Preferences | Build, Execution, Deployment | Docker with the following:

  • Name -> Docker
  • Connect to Docker daemon with -> Unix socket

Set up a server in Settings / Preferences | Languages & Frameworks | PHP | Servers with the name "docker-php", host/port as required, Xdebug for the debugger, and the path mappings as required.

Add an IP address to the whatever it is that has you main host IP like 192.168.1.1

sudo ip addr add 10.254.254.254/24 brd + dev vmnet2 label vmnet2:1

It has been tested with Docker Compose and the following was added to our docker-compose.yml...

  container-name:
    image: bbpdev/symfony:7.1-xdebug
    environment:
      PHP_IDE_CONFIG: "serverName=docker-php"
      PHP_XDEBUG_ENABLED: 1
      XDEBUG_CONFIG: remote_host=10.254.254.254

Todo: Figure out how to make the above permanent.

⁠Building

docker build -f php7.0-v1.0.0/Dockerfile --force-rm -t bbpdev/symfony:php7.0 .
docker build -f php7.1-v1.0.0/Dockerfile --force-rm -t bbpdev/symfony:php7.1 .
docker build -f php7.0-xdebug-v1.0.0/Dockerfile --force-rm -t bbpdev/symfony:php7.0-xdebug .
docker build -f php7.1-xdebug-v1.0.0/Dockerfile --force-rm -t bbpdev/symfony:php7.1-xdebug .

⁠Pushing

docker login

docker push bbpdev/symfony:php7.0-v1.0.0
docker push bbpdev/symfony:php7.1-v1.0.0
docker push bbpdev/symfony:php7.0-xdebug-v1.0.0
docker push bbpdev/symfony:php7.1-xdebug-v1.0.0

Tag summary

Content type

Image

Digest

Size

208.5 MB

Last updated

over 8 years ago

docker pull bbpdev/symfony:php7.1-xdebug-v1.2.0