Preparing A Comfortable Development Environment To Develop A New Symfony Bundle

İbrahim Gündüz
Developer Space
Published in
6 min readNov 23, 2019

--

The Bundle mechanism is a way to make reusable software packages for the PHP applications that use Symfony. It’s probable that a bundle can have own dependencies and needs to be tracking under separate version control. Although Symfony bundles are independent packages, you might still need some application dependencies during the development period in order to check the integrity or simply run the code, besides the tests. So, in this article, I’m gonna try to explain step by step, how to prepare an efficient development environment in order to develop a Symfony bundle.

1. Prepare A Docker Image

Docker is the tool that gonna help us to run the code for a specific PHP version. So, let’s start by creating a new Dockerfile with the following content.

FROM php:7.3-alpine
RUN apk update &&\
apk add curl git unzip make gcc g++ autoconf &&\
pecl install xdebug &&\
docker-php-ext-enable xdebug &&\
curl -sS https://getcomposer.org/installer | \
php -- --install-dir=/usr/local/bin --filename=composer

And run the following command to build the docker image.

$ docker build \
-t php:7.3-composer-alpine \
-f path/your/dockerfile/Dockerfile \
path/your/dockerfile/.

--

--