Comments (4)
Introducing coupling with symfony logic isn't really a cons as this image is designed to be used with Symfony only, but it does create complexity for us to maintain this image for every version of the framework and their different way of defining env var.
Also, this would not be limited to the "dev" env, we would also need the "test" env and for projects with more env i'm afraid it could become cumbersome to extend the env list.
Maybe an env var dedicated to the opcache might be even more explicit for the devs, maybe something like PHP_OPCACHE=mod1/mod2 (default: mod1).
It's less magic and requires people to add this in their override, but less magic is better for us to maintain and arguably better for the end users too i guess ?
from symfony-docker.
Totally agreed with your feedback.
Something like PERFORMANCE_OPTIM=false
to set opcache.enable=0
could be more convenient event if we loose the magic.
But wee need to assume if it's less magic, it could be confusing for newcomers. We MUST put a warning on the README about the default cache configuration to warn users about it.
We could also set PERFORMANCE_OPTIM
to false by default and warn user to enable this config in production environments.
from symfony-docker.
when PERFORMANCE_OPTIM=false, we can set opcache.validate_timestamps=1 instead of opcache.enable=0. With that config, we can still have decent performances in dev.
from symfony-docker.
@jcrombez We need to discuss how to handle this in a development context.
Solution 1 :
A solution could be to read APP_ENV
variables and disable fpm optimisations when container start with this kind of script in entrypoint :
# Disable opcache optimisation for developpement
# Allow files to be reloaded when update without restarting fpm process
. /var/www/.env
. /var/www/.env.local
if [[ "$APP_ENV" = "dev" ]]
then
echo > /etc/php/7.3/fpm/99-symfony.ini
fi
Cons :
- We need to read .env files and introduce coupling with symfony logic (.env.local override .env, etc ...)
- Only compatible with Symfony > 4 (3.4 is supported since Nov. 2020)
Pro :
- Transparent for the developper
Do you have any other idea @jcrombez ?
from symfony-docker.
Related Issues (20)
- Missing xml extension for php7.1 HOT 2
- Update to debian stretch HOT 2
- config nginx defined in site-enabled instead of site-available HOT 2
- configuration file www.conf modified by you or by a script with php7.1-fpm HOT 1
- Add tests
- Support php-fpm logging to stdout
- PHP 7.2 compatibility
- HTTP/2 Support
- directory structure for symfony 4 HOT 9
- Optimize php for Symfony
- Add PHP 7.3 support
- Fix logger hack
- Install unzip command
- Allow to bind mount default nginx configuration HOT 1
- Run scripts on container boot easily (help migration) HOT 1
- Change log stream path HOT 1
- Bad owner of /var/www HOT 1
- Add support for composer 2 HOT 1
- PHP 8 support HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from symfony-docker.