-
Build/run containers with (with and without detached mode)
$ docker-compose build $ docker-compose up -d
-
Prepare Symfony app
-
Composer install & update database
$ docker-compose exec php bash $ composer install $ sf3 doctrine:generate:entities AppBundle/Entity $ sf3 doctrine:schema:update --force
-
-
Enjoy :-)
Just run docker-compose up -d, then:
-
Directory app: visit projectdirectory.dev
-
Symfony dev mode: visit projectdirectory.dev/app_dev.php
-
Logs (Kibana): projectdirectory.dev:5601
-
Account for test:
Login/pwd : admin/admin
-
If you want to add optionnals containers like Redis, PHPMyAdmin... take a look on doc/custom.md.
Have a look at the docker-compose.yml file, here are the docker-compose built images:
db: This is the MySQL database container,php: This is the PHP-FPM container in which the application volume is mounted,nginx: This is the Nginx webserver container in which application volume is mounted too,
This results in the following running containers:
$ docker-compose ps
Name Command State Ports
--------------------------------------------------------------------------------------------------
dockersymfony_db_1 /entrypoint.sh mysqld Up 0.0.0.0:3306->3306/tcp
dockersymfony_elk_1 /usr/bin/supervisord -n -c ... Up 0.0.0.0:81->80/tcp
dockersymfony_nginx_1 nginx Up 443/tcp, 0.0.0.0:80->80/tcp
dockersymfony_php_1 php-fpm Up 0.0.0.0:9000->9000/tcp # bash commands
$ docker-compose exec php bash
# Composer (e.g. composer update)
$ docker-compose exec php composer update
# Same command by using alias
$ docker-compose exec php bash
$ sf3 cache:clear --env=prod --no-warmup
$ sf3 assets:install --symlink
$ sf3 avanzu:admin:fetch-vendor --root