-
Install docker and docker-compose tool.
-
Clone the docker environment repository, and inside it clone the project repository as "symfony":
$: git clone https://github.com/eko/docker-symfony.git $: cd docker-symfony $: git clone https://github.com/gritt/sf4.git symfony
-
Build and start the docker containers
$: docker-compose build $: docker-compose up -d
3.1. Check if the containers are running with:
$: docker-compose ps
-
Enter the "symfony" dir and configure the database connection:
$ cd symfony $ cp .env.dist .env
-
Open the .env file and update line 16 according to database password set in the docker config
# change from: DATABASE_URL=mysql://db_user:db_password@127.0.0.1:3306/db_name #to: DATABASE_URL=mysql://symfony:symfony@docker-symfony_db_1:3306/symfony
-
In your local OS, add a domain entry for symfony.localhost in your /etc/hosts
$: sudo vim /etc/hosts 127.0.0.1 localhost symfony.localhost
-
Back in the "docker-symfony" dir, enter the application container:
$: docker exec -it docker-symfony_php_1 ash
-
In the application container, run composer update to download dependencies:
$: php -d memory_limit=-1 /usr/bin/composer update
-
Also, create the database schema with doctrine:
$: bin/console doctrine:schema:create
-
Also in the application container, create some tags:
$: bin/console add-tag Gadgets $: bin/console add-tag Acessories $: bin/console add-tag Computers $: bin/console add-tag Smartphones $: bin/console add-tag Heaphones
-
DONE! you now have some tags to play around while creating products
-
Access: http://symfony.localhost/product to start