This is my basic docker stack for developing Symfony-Apps.
- Traefik (http://traefik.symfony.local)
- PHP 8.1 (+ Node.js, Yarn & Ansible, see the Dockerfile)
- Xdebug (Port 9000)
- Blackfire (Agent & Probe)
- Nginx 1.22 (http://symfony.local)
- PostgreSQL 14
- Adminer (http://db.symfony.local)
- Mailhog (http://mail.symfony.local)
You'll need either the Symfony Binary or Composer installed.
$ git clone https://github.com/arkste/docker-symfony.git
$ cd docker-symfony
$ symfony new --full Source // or "composer create-project symfony/website-skeleton Source"
$ docker network create proxy
$ docker compose up -d
then update your system host file:
echo "127.0.0.1 symfony.local db.symfony.local mail.symfony.local traefik.symfony.local" | sudo tee -a /etc/hosts
then go to http://symfony.local
-
Why a (big) custom PHP Image? Because most of my servers are running Ubuntu with PHP built by
ondrej/php
and i want to be as close as possible to the target system while developing. The PHP-Container has the recent Node.js- + Yarn-Version installed, which is necessary if you're using Symfony's Webpack Encore. -
Why is X missing? You're free to customize it for your needs. Like adding Redis, RabbitMQ, etc.