-
Notifications
You must be signed in to change notification settings - Fork 336
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
Speed up php-fpm container on MacOS #560
Conversation
COPY docker/php/docker-healthcheck.sh /usr/local/bin/docker-healthcheck | ||
RUN chmod +x /usr/local/bin/docker-healthcheck | ||
|
||
HEALTHCHECK --interval=10s --timeout=3s --retries=3 CMD ["docker-healthcheck"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it helps to know when php-fpm is ready
DATABASE_URL=mysql://[email protected]/sylius_%kernel.environment% | ||
DATABASE_URL=mysql://sylius:nopassword@mysql/sylius |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @tonicospinelli , may I ask why would you want to change it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed it to give a smooth experience for new adopters because the docker is not parameterized for multi-environment yet.
composer install --prefer-dist --no-progress --no-suggest --no-interaction | ||
bin/console assets:install --no-interaction | ||
bin/console sylius:theme:assets:install public --no-interaction | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all these commands already ran during the container build. so, if you need to update some file, just run docker-composer build php
to update files inside the container
9b7a76a
to
d9a3f2d
Compare
@tonicospinelli @arti0090 guys, maybe join forces and split your changes so at least some can be merged sooner.
|
And remove |
The script setup_native_nfs_docker_osx.sh will activate the NFS enabling to speed up the mounted storage. Adding health check for php-fpm container, just running the command `docker-compose ps` it will show if the container is healthiness. The HEALTHCHECK instruction tells Docker how to test a container to check that it is still working. This can detect cases such as a web server stuck in an infinite loop and unable to handle new connections, even though the server process is still running. Separating some commands into RUN instructions allow the Docker to cache the instruction result to reuse in another moment. https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#leverage-build-cache Co-authored-by: Kévin Dunglas <[email protected]> Co-authored-by: arti0090 <[email protected]>
d9a3f2d
to
a04ed77
Compare
I'm closing it to keep only changes related to NFS approach, see you on next PR. |
The script setup_native_nfs_docker_osx.sh will activate the NFS enabling
to speed up the mounted storage.
Adding health check for php-fpm container, just running the command
docker-compose ps
it will show if the container is healthiness.The HEALTHCHECK instruction tells Docker how to test a container
to check that it is still working. This can detect cases such as a
web server stuck in an infinite loop and unable to handle new
connections, even though the server process is still running.
Separating some commands into RUN instructions allow the Docker to cache
the instruction result to reuse in another moment.
https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#leverage-build-cache
Co-authored-by: Kévin Dunglas [email protected]
Co-authored-by: arti0090 [email protected]