Skip to content

Latest commit

 

History

History
39 lines (30 loc) · 995 Bytes

README.md

File metadata and controls

39 lines (30 loc) · 995 Bytes

Create a environment for dev in Symfony 4 projects

  1. Download the env
wget http://github.com/jairoFernandez/symfony-env-docker/archive/master.zip && unzip master.zip -d my_awesome_symfony_project
  1. Build a image
cd my_awesome_symfony_project
docker-compose build
docker-compose up -d

MySql container

docker exec -it -u sf4_mysql bash

PHP container

docker exec -it -u dev sf4_php bash

Inside the container run cd /home/wwwroot/sf4

And create your symfony 4 project

composer create-project symfony/skeleton my-temp-folder
cp -Rf /home/wwwroot/sf4/my-temp-folder/. .
rm -Rf /home/wwwroot/sf4/my-temp-folder

*** This project is a copy of *** https://github.com/romaricp/kit-starter-symfony-4-docker ❤️

PD: When you configure the url of your db connection in symfony, the host is the name of container 'sf4_mysql'

DATABASE_URL=mysql://sf4:sf4@sf4_mysql:3306/sf4