- This project begun as a fork of maxpou/docker-symfony Many thanks
- This is currently inspired in LaraDock/laradock Many thanks
- Clone the project
$ git clone [email protected]:prodriguezval/symfodock.git
The concept of this project is deliver with docker from dev to prod, to achieve that use the docker's .env file to configure some variables for each different environment
$ cp .env.example .env
-
Review the .env file and change the values as you need
-
Update your host file
sudo echo "localhost symfony.dev" >> /etc/hosts
- Build the containers You can start only the services that you need (MySQL, NGINX, PHP-FPM), with this line:
docker-compose up -d nginx mysql
This is fine to begin, but if you need any other service like log reading, or redis look for the alias of the service in the docker-compose.yml and add it to the command like this:
docker-compose up -d nginx mysql elk redis
To integrate SymfoDock with you existing or new symfony project, you must:
- Modify the docker .env file APP_DIR variable with your project folder name
#Common args
...
APP_DIR=my_project_folder_name
...
- The folder structure must be like this:
development (main folder)
- symfodock (symfodock folder)
- my_project_folder_name (your project folder)
- Parameters configuration open your parameters.yml and modify the configuration like this:
parameters:
...
database_host: mysql # like the docker-compose.yml alias
...
database_user: user # MYSQL_USER in param the docker-compose.yml
database_password: secret # MYSQL_PASSWORD in param the docker-compose.yml
...
redis_address: redis # like the docker-compose.yml alias
- Symfony app: visit symfony.dev
- Symfony dev mode: visit symfony.dev/app_dev.php
- Logs (Kibana): symfony.dev:81
- Logs (files location): logs/nginx and logs/symfony
Any contribution will be welcome :)
Enjoy.