-
Notifications
You must be signed in to change notification settings - Fork 0
Introduce environment configurator #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@covex-nn Thanks for the notification and sorry for my late response :) I just had a quick look and I definitely need some more time to have a deeper look and try some things. Are you planning to separate the repository provided by this plugin, so the plugin itself will not provide any (opiniated) environments? I will let you know when I found some more time to play with this plugin and I have more questions. :) |
I planned to separate a plugin and a repository later. Right now it is more convenient to keep them together. These sequences in repository are for personal use, unlike Flex recipes. So, personal repositories will be used for sure. And there was no plans about extending a list of configurators with other plugins. May be later, when there will be at least 3 plugin users or even more =)) UPD: I separated a repository from a plugin, see https://github.com/covex-nn/env-repository |
Why was https://github.com/covex-nn/extra-flex/ abandoned? Also note that in the meantime UPD: I just found https://github.com/kwivix/flexinline/blob/master/src/ComposerPlugin.php for even less code. |
Uh oh!
There was an error while loading. Please reload this page.
Environment configurator is a Composer plugin, it was created to automate frequent routine operations. With console command, this plugin executes sequences of these operations, stored in special repositories.
To show how it works, i prepared a demo, at the end of it you will have fully functional application, running inside Docker containers, with SonataDoctrineORMAdminBundle and FOSUserBundle installed and with configured user management inside admin panel. Please, follow instructions:
Configure local DNS
Add two records to
C:\WINDOWS\System32\Drivers\etc\hosts
or/etc/hosts
file:docker.local 127.0.0.1
andmysql 127.0.0.1
. If you useDocker Toolbox
and Windows as a host, executedocker-machine env
, get IP-address fromDOCKER_HOST
variable and add that IP instead of127.0.0.1
Create a new project
composer create-project symfony/skeleton .
Install plugin, using global installation is recommended:
After installation a new composer command
env:apply
will be available.Install SonataDoctrineORMBundle and FOSUserBundle with user management
Configure local
docker-compose
environmentIf you applied
docker-compose
beforeadmin
, replace host in.env
file forDATABASE_URL
from127.0.0.1
tomysql
manualy.Run Web-server
Default environment uses PHP built-in Web-server
But if you want to use Nginx as Web server or if you do not have PHP 7.2 installed on your host, execute the following instead:
cp docker-compose.override.yml.dist docker-compose.override.yml docker-compose up -d docker-compose exec php bin/console cache:clear
Update database schema and create admin user
or
Even if you have chosen
nginx
as your web-server, you can run console commands from host, it is not necessary to run them inside container. But in this case, there will be 2var
directory: first on the host and the second inside container, and withphp bin/console cache:clear
you will clear cache on your host, not inside VMVisit http://docker.local/admin/
Also, there is a package covex-nn/docker-symfony, it was created via
composer env:apply docker-ci
command. It contains same all docker files from above and some procedures for deployment with GitLab CI/CD Pipeline.The text was updated successfully, but these errors were encountered: