Code Monkey home page Code Monkey logo

Comments (4)

jcrombez avatar jcrombez commented on August 20, 2024 1

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.

eliecharra avatar eliecharra commented on August 20, 2024 1

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.

philippe-levan avatar philippe-levan commented on August 20, 2024 1

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.

eliecharra avatar eliecharra commented on August 20, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.