I am writing Dockerfile for my new PHP application using Symfony 5 with Flex.
One of the build commands I run is follows:
RUN composer dump-env prod
It gives me error:
[Symfony\Component\Console\Exception\CommandNotFoundException]
Command "dump-env" is not defined.
I get it because dump-env command is derived from symfony/flex composer dependency which is located in my require-dev section in composer.json.
I have another instruction in Dockerfile: RUN composer install --no-dev --no-suggest and that's the reason why I get this error - I run dump-env command without symfony/flex installed.
To fix it I can move symfony/flex dependency from require-dev to require section in my composer.json.
So the questions are:
- should I use Symfony Flex in production codebase?
- if no, how I can run
dump-envcommand to increase production performance? - if yes, what are the other reasons to use it? does Flex affects app performance somehow?